Solving test cases.