Trendy Strings
CodeChefOpen on judge ↗
Let, $S$ is a string and $f(c)$ be the number of occurrences of character $c$ in the string $S$. String $S$ is called $groovy$ if $f(A) + f(B) = f(C)$, and $f(x) = 0$ for all $x ∉ \{A, B, C\}$. A string having all its substrings of length $K$ $groovy$ is called a $K-trendy$ string. Given $N$ and $K$, find the number of $K-trendy$ strings of length $N$. Since answer can be large, output answer m
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start