TikTok Circular Clip Analysis
Learn this problemProblem statement
The TikTok team is analyzing clips to measure their unique content strength. Given a string clip of length n consisting of only lowercase English characters, imagine the clip is circular, meaning after the n-th character, the sequence continues from the 1st character again.
Circular Nature: Since the clip is circular, you can form substrings that wrap around from the end of the string back to the beginning. For instance, with the string "yxz", valid substrings include "y","x","z","yx","xz","zy","yxz","xzy" and "zyx".
The "content strength" of a circular clip is determined by the number of unique substrings that consist of only consonants. Your task is to find the content strength of this circular clip.
Function
calculateContentStrength(clip: String) → int
Complete the function calculateContentStrength in the editor.
calculateContentStrength has the following parameter:
string clip: the circular clip whose content strength has to be determined.
Returns
int: the content strength of the circular clip
Examples
Example 1
clip = "bac"return = 3Constraints
🎶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