Tried to solve failed test case. Kindly review a patch.