Leetcode 821. Shortest Distance to a Character Python

preview_player
Показать описание
Full version of this LeetCode solution available on my Udemy course (100 LeetCode videos):
Рекомендации по теме
Комментарии
Автор

The best solution is "For each index S[i], find the distance to the next character C going left, and going right. The answer is the minimum of these two values." Then the time complexity is O(2N). Thanks.

todaytomorrow
Автор

Please do solve this Leetcode 2515 problem also

ravitejavarmam