LeetCode 472. Concatenated Words

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

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

The time complexity issue is in the following comparison:

s[j:i] != s

It is O(len(s)) not O(1).

To address this, replace the above expression with this:

i - j + 1 <= n

kokosda
join shbcf.ru