Refer for the code: -
Failing all the testcases
Hello Ambuj, why are you using global vector it is storing value for the previous test cases as well so if you really want to use vector then you also need to make it clear. And instead of using Find_Nodes_Final function and then sorting inside the main function, you can also use the inorder function and then whenever the value lies in between k1 and k2 you can out that no.
I hope it is clear to you. In case it is clear to you pls mark it as resolve and provide the rating as well as feedback so that we can improve ourselves.
In case there is still some confusion pls let me know, I will surely try to help you out.
Thanks 
Happy Coding !!
Thanks @A17LP0026
Using the inorder traversal I passed all the testcases but I had a doubt regarding this that in my previous code I tried to reduce the no. of visits i.e. to every node using the principle of BST but I am still getting error. Could you help me my old approach and I also tried clearing the vector after every iteration but the testcase is still isn’t passing.