original code

first solution to the test written in haskell
created java solution

eliminated recursive method calls