1358. Number of Substrings Containing All Three Characters
Medium
Given a string s
consisting only of characters a, b and c.
Return the number of substrings containing at least one occurrence of all these characters a, b and c.
Example 1:
Example 2:
Example 3:
Constraints:
3 <= s.length <= 5 x 10^4
s
only consists of a, b or c characters.
解題
注意: Substring 可以重複
Previous1351. Count Negative Numbers in a Sorted MatrixNext1372. Longest ZigZag Path in a Binary Tree ⭐
Last updated