Code not giving desired output
i was debuging the code see in tempans all the ans are zero so no point of adding in ans
here ur indexing is not correct, it should l and r.
now check the constraints , and increase ur array size accordingly
share ur updated code with me ,using cb ide
here it should be >=
for that u need to optimise ur approach.
ok
any hint you can give me?
but i have not studied dp yet
read approach 4.
two pointers
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.