G - Good Subarrays

Languages: C, C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
5 2 4 6 3 3
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
5
--- Showing first 30 lines (click "Copy" to get full content) ---
Input
7 4 8 6 5 5 12 8
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
7
--- Showing first 30 lines (click "Copy" to get full content) ---