Given two arrays, Array1 (a multidimensional array) and Queries array (contains an array of L, R of many queries) ... do a certain operation from L(left index) to R (right index) in a given array and return the array of answers for all the queries.
Asked in the Coding Round stage. For this SQL version, the operation is an inclusive range sum over stored array positions.
query_id and range_sum, one row per query.query_id ascending.| Column | Type | Description |
|---|---|---|
| positionPK | INT | Zero-based position in Array1 |
| element_value | INT | Integer value stored at the array position |
| Column | Type | Description |
|---|---|---|
| query_idPK | INT | Identifier and output order for the range query |
| left_index | INT | Inclusive left boundary |
| right_index | INT | Inclusive right boundary |