P105: Added Java solution.