Logic problems from around the web solved by me in Java