Created
January 18, 2018 08:31
-
-
Save AnthonyMikh/e06f7defb1743d536720572913e3ffbb to your computer and use it in GitHub Desktop.
Решение задачи №62 от UniLecs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List (foldl') | |
solution = flip (-) 1 . foldl' lcm 1 . enumFromTo 1 | |
main = putStrLn . show $ solution 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lcm
из прелюдии считает НОК аргументов.foldl'
является строгой версиейfoldl
и применятеся исключительно из соображений производительности