Company: Servicenow_8june
Difficulty: medium
Get Elements From 2D Array Problem Description A two-dimensional array is represented as a one-dimensional array of integers. The first integer of the array denotes the length of each row of the 2D array. The remaining integers are the elements of the array, arranged row by row. Multiple queries will be made about the 2D array. Each query contains the row and column coordinates of an element to retrieve. Complete the function getElements in the editor. The function is expected to return an INTEGER_ARRAY . The function accepts the following parameters: int arr[n] : an array of integers int queries[q][2] : the row and column positions queried The function should return an array of answers to each query, aligned with queries by index. Examples Example 1: Input: arr = [5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], queries = [[1, 1], [1, 2], [2, 1], [2, 2]] Output: [1, 2, 6, 7] Explanation: The first value, arr[0] = 5 , represents the length of each row of the 2D array. The next 10 elements, arr[1] th