Haskell solutions to 7 and 10, but way too slow.