Not able to understand


is this the right code for thisproblem

Hey @rastogi.g1998,

You have missed a base case.
Rest all is correct.
See this:

Hope, this would help.