Difficulty Level: HARD
Problem Statement:
Given a sorted array arr[] of size N, some elements of the array are moved to either of the adjacent positions, i.e., arr[i] may be present at arr[i+1] or arr[i-1] i.e. arr[i] can only be swapped with either arr[i+1] or arr[i-1]. The task is to search for an element in this array.
Input:
arr[] = {10, 3, 40, 20, 50, 80, 70}, key = 50
Output:
Output is index of 50 in given array i.e. 4