Created
March 24, 2018 05:34
-
-
Save dizzarg/c5fcfa9885d821a153a0d5364f8522f5 to your computer and use it in GitHub Desktop.
MurkyDisgustingModules created by dizzarg - https://repl.it/@dizzarg/MurkyDisgustingModules
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 | |
minfree xs = minform 0 (length xs, xs) | |
minform a (n, xs) | n==0 = a | |
| m == b-a = minform b (n-m, vs) | |
| otherwise = minform a (m, us) | |
where (us,vs) = partition (<b) xs | |
b = a+1+n `div` 2 | |
m=length us | |
main = putStrLn $ show (minfree([0,2,3,4])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment