Question: Arrays and queries Given an array A with N integers, perform queries, You are given the following types of queries: 1. L X change the
Arrays and queries Given an array A with N integers, perform queries, You are given the following types of queries: 1. L X change the value of A, to X. 2. L R. X Find the first index P such that Ap X and L P R. Print P for this type of query. If there is no such P. print -1. Note: Assume 1-based indexing. Function description Complete the solve function. This function takes the following 4 parameters and returns the array of integers orresponding to the query of type 2: N: Represents the number of elements of array A A: Represents the integer array of size N Q: Represents the number of queries Queries: Q arrays, one for each query. Each array contains 3 or 4 integers based on the type of query
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
