Sponsored
Use these hints if you're stuck. Try solving on your own first.
We need only to check all sub-strings of length k.
The number of distinct sub-strings should be exactly 2^k.
Solve with full IDE support and test cases