Solved problem 360 base case