it is giving wierd output in gfg, it gives correct answer for sample test cases on my machine but gfg pr kaafi weird ans aa rha h
I want you check if my code is correct
i have now commented it
there is nowhere start keyword declared in ur code and u are using it for returning the string
sorry my bad
check this… i have made a few changes… hope it works now
it’s giving tle on both leetcode nd gfg let me think first if stucks again i will let you know
bro tabhi to maine O(N) wala soln share kiya hai… video lectures dekha kro na itne ache se smjhaya hai prateek bhaiya ne
ek baar iski time complexity bata do bhaiya
u can say it O(n^2) as u are checking for each instance
do u still have any doubts???
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.