LeetCode 1704: Determine if String Halves Are Alike, 2 approaches in 5 mins

preview_player
Показать описание
Use two pointers, one moving from left to right and another moving from right to left. When the left pointer encounters a vowel, increment the counter, and when the right pointer encounters a vowel, decrement the counter. At the end, if the counter is equal to 0, then the strings are alike.

#leetcode #leetcodedailychallenge #leetCdoe1704
Рекомендации по теме
join shbcf.ru