TikTok Circular Clip Analysis
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.
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
1Example 1
Constraints
Limits and guarantees your solution can rely on.
🎶