Problem · String
Number of Substrings Without Vowels
Learn this problemProblem statement
Given a string (length 1 to 1000), return the number of substrings which don't have any vowels. Circular substrings are valid.
Function
numberOfSubstringsWithoutVowels(s: String) → intExamples
Example 1
s = "abc"return = 3All possible substrings are:
a, b, c, ab, bc, ca, abc, bca, cab
substrings that do not have vowels are:
b, c, bc
so we return 3
Constraints
🙋♀️More Tiktok problems
- Count Access Code PairsOA · Seen Jul 2026
- Count Key ChangesOA · Seen Jul 2026
- Travel Distance on ScootersOA · Seen Jul 2026
- Count Skipped Numbers After SubtractionsOA · Seen Jul 2026
- Obstacle Placement QueriesOA · Seen Jul 2026
- Repeated Grouped Digit SumOA · Seen Jul 2026
- Count Cyclic Digit PairsOA · Seen Jun 2026
- Event ID Check Completion TimesOA · Seen Jun 2026