Sponsored
Use these hints if you're stuck. Try solving on your own first.
What is the maximum possible length of a nice subarray?
The length of the longest nice subarray cannot exceed 30. Why is that?
Solve with full IDE support and test cases