Sponsored
Use these hints if you're stuck. Try solving on your own first.
Enumerate all subarrays and find the ones that satisfy all the conditions.
Use any suitable method to hash the subarrays to avoid duplicates.
Solve with full IDE support and test cases