1
0
Fork 0

Thoughts on 1

main
Bill Ewanick 2023-10-18 23:26:03 -04:00
parent bc3247a792
commit 8144edd676
1 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,9 @@ main = print ans
ans :: Integer ans :: Integer
ans = sum $ allNumbersUnder 1000 ans = sum $ allNumbersUnder 1000
sum' :: Num a => [a] -> a
sum' = foldl (+) 0
isMultipleOf :: Integral a => a -> a -> Bool isMultipleOf :: Integral a => a -> a -> Bool
isMultipleOf n x = x `rem` n == 0 isMultipleOf n x = x `rem` n == 0