Click here to Skip to main content
15,905,419 members

Comments by I RAJ (Top 5 by date)

I RAJ 13-Aug-23 20:22pm View    
Thank you man for responding every time I asked and providing me the answer. But, I wanted to know what exactly was wrong in my solutions. After a couple of days, I finally knew what was wrong, it was setting up the size of (ans) to be data. After removing it, it runs smoothly.
I RAJ 13-Aug-23 5:11am View    
Man, I have used more than 100% percent of my brain. It is totally exhausted now. Please tell me what is wrong in my code?? I am pleading you, please help.
I RAJ 13-Aug-23 4:52am View    
In which function remove or add?
I RAJ 13-Aug-23 4:14am View    
I am doing it step by step. For the above test case, data=5/2=2. In the remove function, I am recursively removing values from top here, so vector_ans will store [5 4] and then I am popping out the value 3 in the base case, then the function will return. Then, in add function I am trying to push the values back to stack. Again, data=2 so ans[data-1]=ans[1]....which is 4 and then next time ans[data-1]=ans[0] which is 5... then I am returning back. I don't find an error plz help me out
I RAJ 13-Aug-23 2:28am View    
I am basically trying to find the error here from last two days. Although, I am not able to get, where am I going wrong? Could you be more specific where exactly I am doing the error?