Live-solving LeetCode #345 - Reverse Vowels of a String

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

My LeetCode Solution Post:

Spreadsheet where I track all the problems I've solved:

My Twitter, LinkedIn, Discord, Patreon, consultation booking page, etc:
Рекомендации по теме
Комментарии
Автор

We can do it with a single for-loop instead of 2. We can keep track of 2 pointers, one at the beginning and one at the end. As soon as we detect vowels in both the pointers we swap.

SidharthPulipaka
visit shbcf.ru