@aritra-crio-ta @Sumanth_Uppala Since i couldn’t think of any approach for the problem i opened the pseudocode hint of the problem and implemented a solution based on that, around 23 test cases are failing in that module. Please help me out.
Please check your code implementations. You are changing the left pointer and right pointer wrongly. Left pointer is suppose to be the left most index which is at isnt sorted . So the check should be
nums[left] < nums[left + 1] instead of
nums[left - 1] < nums[left] . Also according to your code right pointer can never end with
len(nums) - 1 value which is false.
Please correct your code according to your logic.
Hello @aritra-crio-ta, I changed the implementation of the left pointer, and also removed the right pointer condition but, I guess i’m still missing something. Please check it out once again
You still are maintaining a leftPtr == 0 condition in your while loop which is wrong. This is because suppose an array having 6 5 … as the first few 2 elements should have leftPtr = 0 but in your case wont. Also, your code doesn’t take equality into consideration. Work on these 2 issues.
Hi @Myleshen, Is this resolved?
Hello @raghuveer, I couldn’t actually find the time to work on that problem as the current milestone is to work on the Recursion pack. Please close this topic, if I have any doubts I’ll give a reference to this post
Closing this , since your issue is resolved.
Closing this topic as it has been solved by you yourself. Great job, keep working hard. if its not resolved feel free to un-mark the accepted solution to re-open the topic.