Sponsored
Use these hints if you're stuck. Try solving on your own first.
We only need to check substrings of length at most 30, because 10^9 has 30 bits.
Solve with full IDE support and test cases