(java) Solved problem 40