Add solution for the 9th problem