Sponsored
Use these hints if you're stuck. Try solving on your own first.
Using a rolling hash, we can quickly check whether two strings are equal.
Use that as the basis of a dp.
Solve with full IDE support and test cases