1513. Number of Substrings With Only 1s
Description
**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.ac
Last updated