↪️ Window Sliding O(N) ↩️ Simple JavaScript Solution [EASY - UNDERSTANDING]]
\t\tvar numberOfSubstrings = function (s) {\n\t\t\tlet a = 0, b = 0, c = 0, result = 0;\n\n\t\t\tfor (let i = 0, j = 0; i < s.length; i++) {\n\n\t\t\t\tif (s[i]
\t\tvar numberOfSubstrings = function (s) {\n\t\t\tlet a = 0, b = 0, c = 0, result = 0;\n\n\t\t\tfor (let i = 0, j = 0; i < s.length; i++) {\n\n\t\t\t\tif (s[i] == \'a\') a++;\n\t\t\t\tif (s[i] == \'b\') b++;\n\t\t\t\tif (s[i] == \'c\') c++;\n\n\t\t\t\twhile (a && b && c) {\n\t\t\t\t\tresult += s.length - i;\n\n\t\t\t\t\tif (s[j] === \'a\') a--;\n\t\t\t\t\tif (s[j] === \'b\') b--;\n\t\t\t\t\tif (s[j] === \'c\') c--;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t};
['C', 'Sliding Window', 'Java', 'JavaScript']