Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 4
- ntoList :: Integer -> [Integer] -> [Integer]
- ntoList n l | (n == 0) = (reverse (filter even l))
- | otherwise = ntoList (div n 10) ( (mod n 10) : l )
- listtoN :: [Integer] -> Integer
- listtoN l = foldl (\x y -> x*10 + y ) 0 l
- strangeCompare :: Integer -> Integer -> Ordering
- strangeCompare a b = compare (listtoN (ntoList a [0])) (listtoN (ntoList b [0]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement