Search⌘ K
AI Features

Solution: Number of Substrings Containing All Three Characters

Solution: Number of Substrings Containing All Three Characters asks you to count substrings of a string that contain at least one a, b, and c.

Statement

Given a string s that consists only of the characters 'a', 'b', and 'c', return the number of substrings that contain at least one occurrence of each of the three characters.

Constraints:

  • 3≤3 \leq ...