provided solution for 12-th problem