add solution to fifth problem