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

Показать описание
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)
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)