Problem 3 completed in Java
Problem 3 completed in Python
Problems 4 and 5 completed in Java