provided solution for 10-th problem