P98: Added Java solution.
P323: Added Haskell solution, tweaked Java solution.