# ---
# title: 1358. Number of Substrings Containing All Three Characters
# id: problem1358
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: String
# link: <https://leetcode.com/problems/number-of-substrings-containing-all-three-characters/description/>
# hidden: true
# ---
# 
# 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:**
# 
#     
#     
#     Input: s = "abcabc"
#     Output: 10
#     Explanation: The substrings containing at least one occurrence of the characters  _a_ ,  _b_  and  _c are "_abc _" , "_abca _" , "_abcab _" , "_abcabc _" , "_bca _" , "_bcab _" , "_bcabc _" , "_cab _" , "_cabc _" _and _ "_abc _" _( **again** ) _._
#     
# 
# **Example 2:**
# 
#     
#     
#     Input: s = "aaacb"
#     Output: 3
#     Explanation: The substrings containing at least one occurrence of the characters  _a_ ,  _b_  and  _c are "_aaacb _" , "_aacb _" _and _ "_acb _"._ __
#     
# 
# **Example 3:**
# 
#     
#     
#     Input: s = "abc"
#     Output: 1
#     
# 
# 
# 
# **Constraints:**
# 
#   * `3 <= s.length <= 5 x 10^4`
#   * `s` only consists of  _a_ , _b_ or _c  _characters.
# 
# 
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end
