problem 99 solution
for problem 99