flexible spaces in haskell. passes local tests but gets run time error on kattis