Tag Archives: array-range-queries

Given a 2-D matrix mat[][] of size N * N, initially all the elements of the matrix are 0. A number of queries(M ranges) needâ€¦ Read More
Given N numbers and two numbers L and R, the task is to print the count of numbers in the range [L, R] which areâ€¦ Read More
Given an array of N integers, the task is to perform the following two operations on the given array: query(start, end) : Print the numberâ€¦ Read More
Given a string str. Now for every query consisting of two integer L and R, the task is to find the number of indices suchâ€¦ Read More
Given two integers and , the task is to find the sum of all the palindromic numbers within the range [L, R] which are of odd length.Examples:  â€¦ Read More
Given an integer m and n ranges (e.g. [a, b]) which are intersecting and overlapping. The task is to find all the number within theâ€¦ Read More
Given N segments as ranges [L, R] where ranges are non-intersecting and non-overlapping. The task is to find all number between 1 to M thatâ€¦ Read More
Pre-requisites: Segment Tree Given an array of digits arr[]. Given a number of range [L, R] and a digit X with each range. The taskâ€¦ Read More
Given an array A having N elements and two integers L and R where, and . You can choose any element of the array (let’s say ax)â€¦ Read More
Given N ranges of L-R. The task is to print the number which occurs the maximum number of times in the given ranges.  Note: 1â€¦ Read More
Given N ranges and Q queries consisting of numbers. Every range consists of L and R. The task is to check if the given numberâ€¦ Read More
Given Q queries and an empty list.  The queries can be of two types:  addToList(x) : Add x to your list. removeFromList(x) : Remove xâ€¦ Read More
Given an array arr[0 . . . n-1]. The task is to perform the following operation:  Find the maximum of elements from index l toâ€¦ Read More
Given an array of N positive integers. The task is to perform the following operations according to the type of query given. 1. Print the maximumâ€¦ Read More
Prerequisites: Fenwick Tree (Binary Indexed Tree)Given an array of N numbers, and a number of queries where each query will contain three numbers(l, r andâ€¦ Read More