w + w for some non-empty string w. For example, "tictic" and "aa" are doubled, while "tic" and "abba" are not.
Given a string text, count how many **distinct** substrings (contiguous pieces) of it are doubled. Equal substrings found at different positions count once.text="xyxyxy" → 2
"xyxy" and "yxyx" qualify. "xyxy" appears twice but is counted once.
text="moon" → 1
Only "oo" = "o" + "o" qualifies.
text="abc" → 0
text) ≤ 2000text consists of lowercase English letterstext="xyxyxy"
2
Run checks the first 3 tests in your browser. Submit checks all 99 tests on the server, hidden ones included.