Adding solution for Example 10.