Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nousevat :: [Int] -> [[Int]]
- nousevat [] = [[]]
- nousevat (x:xs) = sorted:nousevat rest
- where helper = nousevat' xs [x]
- sorted = fst helper
- rest = snd helper
- nousevat' :: [Int] -> [Int] -> ([Int], [Int])
- nousevat' [] res = (res, [])
- nousevat' (x:xs) res = if x > (res !! 0) then nousevat' xs (x:res) else (res, (x:xs))
Add Comment
Please, Sign In to add comment