Sponsored
Use these hints if you're stuck. Try solving on your own first.
Find the longest suffix which is also a prefix and whose length is a multiple of <code>K</code> in <code>O(N)</code>.
Use Z-function.
Solve with full IDE support and test cases