https://ide.codingblocks.com/s/233115… I did exactly which is told in the hint video but still it is not passing all the cases
It is showing error in some test cases
@dhirenkinha Your method seems to be correct, It might be giving TLE, as you are calling function and is passing map, map by default is passed by value so it takes extra O(n) time to create copy and we have 10^5 queries and array size it self can be 10^5 so this can lead to TLE.
Simply remove the function, and put an if condition in place of func call.
Or pass by refrence.
If this resolves your doubt mark it as resolved.