Dsa
Sliding Window
Medium
Contiguous Subarray Reversal
Given an integer array, you can reverse any one contiguous subarray in the array. Find the maximum number possible from the array after one reversal.
Input:
A single line with n integers (-10^6 <= arr[i] <= 10^6).
Output:
An integer representing the maximum value achievable after one reversal of a contiguous subarray.
Example:
Input:
3 1 2 4 5
Output:
5
Key concepts
sliding_windowarraysubarray
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now