Ques link :
I want to solve this question by
STL only and mainly by unordered_map.
According to me solution is in O(N) only.
But I am getting TLE. I think find() function’s time complexity going from O(1) to worst case!!?
Here is my attempt:
So how to solve this question efficiently w/o Sliding Window technique?
May 16, 2020, 8:56am
O(N) in the worst case:
and some challenge authors
will exploit this.
@ssjgz so there is no way to easily do this with unordered_map! we need to switch over to sliding window?? or there is any other easy method?
May 16, 2020, 10:18am
Why not just try a
@ssjgz bro map also giving tle!! i am so confused now!!
10^7 is way too much for a map.
Hint : All elements are positive.
actually i am a new to cp… so don’t know many of the cool algos so can you pls guide me?