Skip to content

Tag Archives: array-range-queries

Given two positive integers N and K, initialize an empty array arr[] and Q number of queries of the following two types: addInteger(x): Insert element… Read More
Given an array arr[] consisting of N integers, ( initially set to 0 ) and an array Q[], consisting of queries of the form {l,… Read More
Given an array arr[] consisting of N integers and an array Q[] of M pairs representing a query of type {X, Y}, the task is… Read More
Given an array arr[] consisting of N positive integers and an array Query[][2] consisting of Q queries of the form {L, R}, the task is… Read More
Given an array arr[] consisting of N integers and an array Q[][2] consisting of M queries of the form {L, R}, the task for each… Read More
Given an array arr[] consisting of N positive integers and a 2D array Q[][] consisting of queries of the type {i, val}, the task for… Read More
Given a string S of length N and a 2D array of strings Q[][] consisting of M queries of the following type: Query(“U”, “I”, “X”):… Read More
Given an array arr[] consisting of N 0s (1-based indexing) and another array query[], with each row of the form {L, R}, the task for… Read More
Given an Array arr[] of positive integers of size n. We are required to perform following 3 queries on given array – 1) Given L… Read More
Given a matrix A[][] of size N * M and a 2D array queries[][] consisting of Q queries of the form {L, R}, the task… Read More
Given an array arr[] consisting of N positive integers and a 2D array queries[][] of the type {a, K, X} such that if the value… Read More
Given an array arr[] and an array query[] consisting of Q queries, the task for every ith query is to count the number of subarrays… Read More
Given an array arr[] consisting of N distinct integers and an array Q[] representing queries, the task for every query Q[i] is to find the… Read More