Leetcode Daily Challenge | Count Number of Homogenous Substrings | O(N) approach

preview_player
Показать описание
Approach:
Iterate to get a homogeneous substring
Count the number of substring we can generate from that homogenous substring
Return the sum.

Time: O(N)
Space O(1)
Рекомендации по теме
welcome to shbcf.ru