The solution failed to handle two test cases.