McNuggets problem: Difference between revisions
→{{header|Haskell}}: Simplified with (\\) (difference) function
(→{{header|Haskell}}: Added a Haskell draft) |
(→{{header|Haskell}}: Simplified with (\\) (difference) function) |
||
Line 89:
=={{header|Haskell}}==
<lang haskell>import Data.List (
import Data.Ord (comparing)
nuggets :: [Int]
nuggets =
(\\) [100,99 .. 1] $
[0 .. quot 100 6] >>=
\x ->
Line 105 ⟶ 104:
in [ v
| 101 > v ]
main :: IO ()
main =
print $
case
Just
Nothing -> "No unreachable quantities found ..."</lang>
<pre>43</pre>
|