LeetCode 1371. Find the Longest Substring Containing Vowels in Even Counts

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

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

I think an important thing to sort of internalize is that when you insert a parity into the hashmap, you are guaranteed that this is the earliest index at which this parity is found. So everytime you encounter this parity again, you are comparing it with the earliest index you encountered this parity, which gives you the longest length as i keeps increasing. Thanks for the great video, took a little while to digest but seems to be very helpful in solving problems with a similar recurring pattern!

akhilmn
Автор

best explanation sir. thanks you so much

rakshitgupta
Автор

Nice explanation, tricky to get the insight to check for parity. I used a stringbuilder as my bitmask because it was simpler to deal with.

gremlan