Perf test cases 7, 8 ,9 are failing

perf test cases 7, 8, 9 are failing for my code. I am following the same approach as given in the sample video but then also the test cases are failing.

You are using a Hashmap here. So if 2 occurs twice in the tree ( hence twice in the inorder traversal) it will occur only once in the in the Hashmap which is wrong. Also you need to ensure that you search only in the range [l,r] in the inorder and not outside that . The hashmap goes against that . Using a linear search in the range [l,r] will solve the issue.

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.