add solution to Q3.6