Program to reverse a Subarray in a given Array.
Given an array Arr of N integers, the task is to reverse a subarray of that array. The range of this subarray is given by L and R.Examples:Input: arr = , L = 1, R = 5Output: Input: arr = , L = 0, R = 2Output: Approach: Follow the steps below to solve the problem:If the size of the sub-list is 1, then return the array.If the size of the sub list is 2, then swap if the range lies between them.Else, Start swapping from L and R up to the mid of (L + R).Below is the implementation of the above approach:Python3 def…