I decided to use haskell as it has been awhile since I've touched it, I made the mistake of not compiling with -O for the first question (and it did not complete in the 8 minutes). When I re-ran afterwards (sadly no points) with -O it completed very quickly.