Solutions to problems from careercup.com developed in Java