/r/dailyprogrammer challenge solutions in Java