Find the Longest Substring Containing Vowels in Even Counts - Leetcode 1371 - Python

  Рет қаралды 15,550

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 67
@varane27
@varane27 4 ай бұрын
this should be HAAAARD! No way I could solve this in an interview without some hints.
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
yeah it's pretty tricky dicky
@stoppls1709
@stoppls1709 4 ай бұрын
​@@NeetCodeIO💀
@NitinSinghMinVlogs
@NitinSinghMinVlogs 4 ай бұрын
@@NeetCodeIO "dick"y
@brij4887
@brij4887 4 ай бұрын
𝓕𝓻𝓮𝓪𝓴CodeIO
@imrozkhan71
@imrozkhan71 4 ай бұрын
@@brij4887 lmaooo
@RockStarPunk0
@RockStarPunk0 4 ай бұрын
19:28 thanks for remainding me
@mohammadaminkhaje8224
@mohammadaminkhaje8224 4 ай бұрын
girlfriend -> doesn't make you better leetcode neetcode -> makes you better at leetcode conclusion: neetcode wins
@Tab-It
@Tab-It 4 ай бұрын
Make neetcode your girlfriend
@sudesh6807
@sudesh6807 4 ай бұрын
Good. now are expert at leetcode and u will die single
@pravyn350
@pravyn350 4 ай бұрын
Yeah 😂
@sidazhong2019
@sidazhong2019 Ай бұрын
girlfriend makes you worse at leetcode
@harshitjain8820
@harshitjain8820 4 ай бұрын
Didn't even had to watch the coding part, just soo good! 🔥🔥🔥🔥
@baetz2
@baetz2 4 ай бұрын
19:28 My wife doesn't allow me to have a girlfriend, so I'm watching
@mohd.tabishkhan4868
@mohd.tabishkhan4868 4 ай бұрын
man you gotta do leetcode even after marriage, damn i am sad now. Life is hard im just in college rn
@ewiz_0262
@ewiz_0262 4 ай бұрын
No way
@attilauhljar3636
@attilauhljar3636 4 ай бұрын
This should definitely be a hard problem, no way I'd come up with this solution on the spot, and i started with assembly back in the days. Thanks for the great and clear explanation, as always
@vrajrana2175
@vrajrana2175 4 ай бұрын
19:28 trolled me : ❌ Trolled Himself : ✅
@minaFbeshay
@minaFbeshay 4 ай бұрын
23:48 you can even remove the "else" keyword, after swapping the two conditions for (int i =0; i< s.length(); i++){ char c = s.charAt(i); mask = mask ^ vowels.getOrDefault(c, 0); if (map[mask] == -1 && mask != 0) map[mask] = i; ans = Math.max(i - map[mask], ans); }
@guitarfanatics77
@guitarfanatics77 4 ай бұрын
​ @NeetCodeIO this is so hard for someone like me who never solve a bitmask problem before, and I just checked the problems with bitmask tag on leetcode and they are all medium difficulty. Is there any easier problem for noob like me to practice bitmask?
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
Here's one we solved this week: kzbin.info/www/bejne/eXfEY4edfq2AhJI
@ihor4256
@ihor4256 4 ай бұрын
if someone asks you to use bit operations in an interview - they don't want you to work there
@aryansuvarna4923
@aryansuvarna4923 4 ай бұрын
what an insane solution. well played
@sauravsingh4497
@sauravsingh4497 4 ай бұрын
thank you i would have never got the solution if it wasn't for you
@DhanushBRaj
@DhanushBRaj 4 ай бұрын
From 19:28.... I'm still watching in loop...!
@harshugamer7776
@harshugamer7776 4 ай бұрын
19:24 , I am watching
@shauryatomer1058
@shauryatomer1058 4 ай бұрын
thanks for this great explanation
@MP-ny3ep
@MP-ny3ep 4 ай бұрын
Thank you so much !
@IamAbhiinav
@IamAbhiinav 4 ай бұрын
LeetCode cooked with this one
@darshanrokkad5216
@darshanrokkad5216 4 ай бұрын
thank you
@taozhaojun
@taozhaojun 4 ай бұрын
I don't have a girlfriend🤣
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
that's why i'm here friend 🫂
@taozhaojun
@taozhaojun 4 ай бұрын
it is more clear to write mask ^= (1
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
damn you're write, clever.
@pravyn350
@pravyn350 4 ай бұрын
@@NeetCodeIO😂 can you act as my GF too !
@StellasAdi18
@StellasAdi18 4 ай бұрын
Surely this is hard
@matalamedo
@matalamedo 4 ай бұрын
For all of y'all who feel bad for being unable to solve this one, don't. This should've been a hard problem.
@NandanUpadhyay-w2f
@NandanUpadhyay-w2f 4 ай бұрын
Can we actually code hashMap soln ??
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
Yeah but would probably need to serialize the hashmap into a string. Also should probably just use a hash set rather than a map, I just drew a map because the mapping makes it easier to visualize
@rajsuriyang3427
@rajsuriyang3427 4 ай бұрын
i've no idea. I don't think i can get to FAANG.
@testAccount-eb2ve
@testAccount-eb2ve 4 ай бұрын
Right now you may not, but with patience and practise you can 😃
@sauravsingh4497
@sauravsingh4497 4 ай бұрын
i tried the sliding window solution by storing the rightmost index of every vowel in the string but it didn't work
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
yeah i believe i explained why it doesnt work
@sauravsingh4497
@sauravsingh4497 4 ай бұрын
@@NeetCodeIO yep thank you for such a great explaination
@elmirshidev
@elmirshidev 4 ай бұрын
I have a gf that is why I did not look at the second solution,thanks Neetcode
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
My man
@venkatgaddam6587
@venkatgaddam6587 4 ай бұрын
This is definitely not a medium question!!!.
@khatora
@khatora 4 ай бұрын
can anyone explain how this is right mask^=(1+ord(c)-ord('a)); I think it should be like this flib the bit corresponding to the character mask ^= (1
@BootBoot-rl1kv
@BootBoot-rl1kv 4 ай бұрын
day by day why coders are becoming trollers
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
Solving these gets boring sometimes, just trying to entertain myself tbh
@BootBoot-rl1kv
@BootBoot-rl1kv 4 ай бұрын
@@NeetCodeIO 😂😂 i understand
@buckwheatplate8770
@buckwheatplate8770 4 ай бұрын
I'm gonna have a long walk after this...
@romanivanov6183
@romanivanov6183 4 ай бұрын
Why do we need this bitmask? Why not just simple dictionary?
@shikher4559
@shikher4559 4 ай бұрын
I watched the complete video which means i dont have a ....
@ewiz_0262
@ewiz_0262 4 ай бұрын
Nah, I'd leave
@ChetanAnnam
@ChetanAnnam 4 ай бұрын
Most confusing and difficult
@yang5843
@yang5843 4 ай бұрын
Don't see why people are calling this problem a hard, you can use prefix sum and solve this as a medium at best
@thepriestofvaranasi
@thepriestofvaranasi 4 ай бұрын
Can you please elaborate on how prefix sum is used for this problem? Thanks.
@yang5843
@yang5843 4 ай бұрын
​​@@thepriestofvaranasiso you iterate left to right for each char of the array, if you are currently at an odd number of vowels, and you encounter the same set of odd vowels before, then you know odd - odd = even, I'm simplifying my explanation a bit but you're basically keeping track of the occurrences of each vowel as you iterate through the array
@hadizorkot2889
@hadizorkot2889 4 ай бұрын
​@@yang5843so basically what he just explained but worse
@pruthvinarayana9568
@pruthvinarayana9568 4 ай бұрын
hey Neetcode , why do you look like an indian?
@NeetCodeIO
@NeetCodeIO 4 ай бұрын
that's a LC easy.. I'm sure you can figure it out :)
@pruthvinarayana9568
@pruthvinarayana9568 4 ай бұрын
@@NeetCodeIO Huge respects , Thanks for carrying us ❤
@immortal4091
@immortal4091 4 ай бұрын
Neetcode -> If you don't have a girlfriend, keep watching Me -> Watching bro, you don't have to point it out🥲🥲
Minimum Time Difference - Leetcode 539 - Python
21:43
NeetCodeIO
Рет қаралды 9 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Find Kth Bit in Nth Binary String - Leetcode 1545 - Python
22:27
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 343 М.
Rabin Karp - Shortest Palindrome - Leetcode 214
22:07
NeetCodeIO
Рет қаралды 20 М.
Maximum Width Ramp - Leetcode 962 - Python
14:47
NeetCodeIO
Рет қаралды 18 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН