we are passing our values of index ,open and close all are 0 then how it works in if(open<ind) and if(close<ind) They all have the same value at first thus it might get failed or goes into infinite loop.
How it is working when the values are same of index ,open and close
hello @priya_Jain
no it will work .
there is one condition when this fails i.e when open==n and close==n . but we have already added base case to handle it .
apart from this one of the two mentioned conditions will always satisfy.