Company: Amazon_29Aug
Difficulty: medium
Permutation Sorter Problem Description A team is testing a new tool called the Permutation Sorter, built to reorder sequences using a restricted set of moves. Given a permutation of integers, the goal is to sort it into increasing order using only these two operations: Reverse the entire permutation. Move the first element of the permutation to the last position, i.e., change arr[0], arr[1], ..., arr[n-1] into arr[1], arr[2], ..., arr[n-1], arr[0] . Formally, given a permutation arr of size n , find the minimum number of operations needed to bring it into increasing order. It is guaranteed that the given permutation can always be sorted using only these two operations. Note: A permutation of length n is a sequence of integers from 1 to n in which each value appears exactly once. Function Description Complete the function findMinimumOperations in the editor below. findMinimumOperations has the following parameter: int arr[n] : A permutation of length n Returns: int : minimum number of o