(java) Solved problem 25
(java) Solved problem 26