Not able to pass the test cases?

Sharad, you need to modify the code little bit,
Try to follow the approach given in the video lecture as,