Sponsored
Use these hints if you're stuck. Try solving on your own first.
We can try all substrings by brute-force since the constraints are very small.
Solve with full IDE support and test cases