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

preview_player
Показать описание


0:00 - Read the problem
0:30 - Drawing Explanation
7:05 - Dry Run
14:46 - Coding Explanation
19:09 - Coding Explanation 2

leetcode 1371

#neetcode #leetcode #python
Рекомендации по теме
Комментарии
Автор

this should be HAAAARD! No way I could solve this in an interview without some hints.

varane
Автор

girlfriend -> doesn't make you better leetcode
neetcode -> makes you better at leetcode

conclusion: neetcode wins

mohammadaminkhaje
Автор

Didn't even had to watch the coding part, just soo good! 🔥🔥🔥🔥

harshitjain
Автор

19:28 trolled me : ❌
Trolled Himself : ✅

vrajrana
Автор

19:28 My wife doesn't allow me to have a girlfriend, so I'm watching

baetz
Автор

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

attilauhljar
Автор

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);

}

minaFbeshay
Автор

thank you i would have never got the solution if it wasn't for you

sauravsingh
Автор

​ @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?

guitarfanatics
Автор

From 19:28.... I'm still watching in loop...!

DhanushBRaj
Автор

if someone asks you to use bit operations in an interview - they don't want you to work there

ihor
Автор

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 << (ord(c) - ord('a')))

khatora
Автор

i've no idea. I don't think i can get to FAANG.

rajsuriyang
Автор

For all of y'all who feel bad for being unable to solve this one, don't. This should've been a hard problem.

matalamedo
Автор

This is definitely not a medium question!!!.

venkatgaddam
Автор

I have a gf that is why I did not look at the second solution, thanks Neetcode

elmirshidev
Автор

i tried the sliding window solution by storing the rightmost index of every vowel in the string but it didn't work

sauravsingh
Автор

Why do we need this bitmask? Why not just simple dictionary?

romanivanov
Автор

I'm gonna have a long walk after this...

buckwheatplate
Автор

day by day why coders are becoming trollers

BootBoot-rlkv