Time Complexity of the implementation shown in the video should be O(nlogn) as Set.find() function takes logn time for each element and there are n elements to be checked.
Time Complexity is not O(n)
The time complexity of set find operation is O(log n) while for unordered_set, it is O(1).
Here unordered set has been used.