really awesome job man! was stuck on this question for a couple hours. searched around youtube and your explanation was the best one. period.
@crackfaang2 жыл бұрын
Thank you for the kind words! If there’s any videos you’d like to see, let me know and I can make the videos
@izzuddinsyamil14792 жыл бұрын
same! this is the best solution to understand and follow thanks
@xRoshtack2 жыл бұрын
Great video!
@crackfaang2 жыл бұрын
Glad you enjoyed the video! Make sure to subscribe and let me know if there’s any problems you’d like me to make videos for
@xRoshtack2 жыл бұрын
@@crackfaang Can you do Leetcode 2060?
@subee12810 ай бұрын
Thanks
@symbol7672 жыл бұрын
Wow this solution is epic and really great explaination, you're super underrated dude. Liked! We gotta get you more popular, this video is too good
@ThisIsntmyrealnameGoogle2 жыл бұрын
awesome explanation! Subscribed!
@abdullahgarra84772 жыл бұрын
I don't really get why it is O(N)🤔
@TheQuancy2 жыл бұрын
Just because there is a nested loop, doesnt necessarily mean that its N^2 The for loop is iterating through the frequency dictionary, while the while loop is iterating through the hashset. If the while loop was also iterating through the dictionary, then yes, it would be N^2, but its 2 separate data structures
@ebenezeracquah478 Жыл бұрын
The reason is that the for loops are not nested. There are two separate for loops. The first one is in Counter(s) which traverse s and stores it in key-value pairs in a dictionary. And the second for loop traverses the key-value pairs to delete the keys with equal counts. So as he said the time complexity is O(n) + O(n) which is ultimately O(n).