Recursion(Last Index)

How to find the last occuring index of an element in the array in increasing stack of recursion instead of decreasing stack. (As you said in previous recursion video that we get 2 chances of getting the value from recursion, 1st is in increasing stack/stack is building and 2nd is when the stack is decreasing.)

Hii Pranshu,
For finding last index of element in increasing stack of recursion you have to add one more variable in function i.e. ans, and initially you pass ans = -1. While give recursive call if you find the element at that index reinitialize ans with that index and make recursive call with new ans and si + 1. At base condition I.e. si == end, you will simply just return the ans.