Given an array arr[], form pairs by pairing the first element with the last element, the second element with the second last element, and so on. If the array has an odd number of elements, pair the middle element with itself. Return all the formed pairs in the order they are created.Examples:Input: