Sponsored
Sponsored
Solve with full IDE support and test cases
Use these hints if you're stuck. Try solving on your own first.
Since n is small, we can just check every substring, and if the substring is semi-repetitive, maximize the answer with its length.