Company: PayPay_1aug
Difficulty: medium
Rotate to Descending Order Given an integer array, move exactly `t` elements from its end to its beginning, for some `0 <= t < n`. Print a value of `t` for which the resulting array is sorted in non-increasing order, or `-1` if no such rotation exists. Input Format The first line contains `n`. The second line contains `n` integers. Output Format Print the required number of right-rotation positions, or `-1`. Constraints `1 <= n <= 200000`; values fit in signed 64-bit integers. Examples `4` / `1 4 2 3` produces `-1`. `5` / `3 2 1 5 4` produces `2` because rotating right by two yields `5 4 3 2 1`.