Leetcode 3008 - Beautiful Indices in the Given Array II - Python

preview_player
Показать описание
Solution, explanation, and complexity analysis for LeetCode 3008 in Python

Problem Description:

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

nice explanation, thanks!
but I have doubts that the rolling hash will always accurately find indexes, i.e. is it possible for different strings of equal length the hash can be the same?

I tried to prove that the rolling hash always find indices correctly, using following observations:

1) Maximum length of the string with unique characters is 26
2) The length of two comparing strings are same

but I didn't find any idea how to use these observations to prove that the rolling hash works

azizkudaikulov