1513. Number of Substrings With Only 1s
https://leetcode.com/problems/number-of-substrings-with-only-1s/
Input: s = "0110111"
Output: 9
Explanation: There are 9 substring in total with only 1's characters.
"1" -> 5 times.
"11" -> 3 times.
"111" -> 1 time.Input: s = "101"
Output: 2
Explanation: Substring "1" is shown 2 times in s.Input: s = "111111"
Output: 21
Explanation: Each substring contains only 1's characters.Last updated