Last problems

Last problems (Problem1.java)