Leetcode 777. Swap Adjacent in LR String - simultaneous linear traversal

preview_player
Показать описание
A Python "simultaneously linear traversal" solution to Leetcode 777 - Swap Adjacent in LR String. The solution here is the same as the solution to:
Leetcode 2337. Move Pieces to Obtain a String - simultaneously linear traversal
See relevant videos @codeyao9796
Рекомендации по теме
Комментарии
Автор

while i < n or j < n: in this line
why didn't we use and operator instead of using or operator and then later breaking if i==n or j==n ?
can anyone please clarify this to me cause am stuck here

Naazneennewreset-hxtj
join shbcf.ru