My attempt at the first r/dailyprogrammer challenge, marked [easy], in Java.