add solution to class4/ex2