McNuggets problem: Difference between revisions

m
Line 1,292:
<lang r>results<-setdiff(0:100,mcNuggets)
cat("The non-McNuggets numbers that are no greater than 100 are:",results,"\nThe largest is",max(results),"\n")</lang>
<lang r>rUltimatelyUltimately, this can be done in one line:
max(setdiff(0:100,rowSums(expand.grid(seq(0,100,6),seq(0,100,9),seq(0,100,20)))))</lang>
{{output}}
331

edits