Input: N = 5, arr[] = {3, 7, 8, 1, 33}, Q = 4, Queries[][] = {{1}, {2, 8}, {3, 2, 4}, {2, 1}
Output: 2 1
Explanation: Process query wise first is 1 so reverse the list [33, 1, 8, 7, 3], Second query 2 8 so find index of element 8 which is 2, third query is 3 2 4 so swap 2nd and 4th index new array=[33, 1, 3, 7, 8] now the last query is 2 1 so find index of element 1 which is 1 so output 2 1.
Input: N = 6, arr[] = {6, 33, 9, 22, 45, 4}, Q = 5, Queries[][] = {{1}, {3, 0, 4}, {2, 33}, {1}, {2, 9}}
Output: 0 2