# Tag Archives: array-range-queries

Given an array arr[] and an array Q[][] consisting of queries of the form of {L, R}, the task for each query is to find… Read More
Given an array arr[] consisting of N 0s and a 2D array Q[][] consisting of queries of the following two types: 1 L R X:… Read More
Given a 2D array arr[][] with each row of the form of a query { L, R }, the task is to count the numbers… Read More
Given an array arr[] consisting of positive integers and an array Q[][] consisting of queries, the task for every ith query is to count array… Read More
Given an array arr[] of size N and a 2D array Q[][] consisting of queries of the following two types: 1 X Y: Update the… Read More
Given an array arr[] of size N and an array Q[] consisting of M integers, each representing a query, the task for each query Q[i]… Read More
Given an array arr[] consisting of N integers and an array Queries[] consisting of Q queries of the type {X, L, R} to perform following… Read More
Given an array arr[] of size N and a 2D array Q[][], consisting of queries of the following two types: 1 X Val: Update arr[X]… Read More
Given an array arr[] consisting of N 0s and an array Q[][] with each row of the form (L, R)., the task for each query… Read More
Given an array arr[] of size N, and an array Q[][] with each row representing a query of the form { X, Y }, the… Read More
Given a binary array arr[] of size N and a 2D array Q[][] containing K queries of the following two types: 1 : Print the… Read More
Mo’s Algorithm is a generic algorithm. It can be used in many problems that require processing range queries in a static array, i.e., the array… Read More
Given a string str consisting of N lowercase characters and an array Q[][] with each row of the form {l, r} representing a query. For… Read More
Given a 2D matrix mat[][] of size N * M, the task is to find the median of Bitwise XOR of all possible submatrices from… Read More
Given an array arr[] consisting of N elements and an arrayQ[], the task for each query is to find the length of the longest prefix… Read More