## Find the Initial Array from given array after range sum queries

Given an array arr[] which is the resultant array when a number of queries are performed on the original array. The queries are of the… Read More »

## Print matrix after applying increment operations in M ranges

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 »

## Count numbers in a range that are divisible by all array elements

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 »

## Queries for Composite numbers in subarray (With Point Updates)

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 »

## Count number of indices such that s[i] = s[i+1] : Range queries

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 »

## Sum of all odd length palindromic numbers within the range [L, R]

Given two integers and , the task is to find the sum of all the palindromic numbers within the range [L, R] which are of… Read More »

## Find the missing elements from 1 to M in given N ranges | Set-2

Given an integer and ranges (e.g. [a, b]) which are intersecting and overlapping. The task is to find all the number within the range that… Read More »

## Find the missing elements from 1 to M in given N ranges

Given segments as ranges [L, R] where ranges are non-intersecting and non-overlapping. The task is to find all number between 1 to that doesn’t belong… Read More »

## Queries to check whether a given digit is present in the given Range

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 »

## Find maximum points which can be obtained by deleting elements from array

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… Read More »

## Maximum occurred integer in n ranges | Set-2

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 »

## Queries to check if a number lies in N ranges of L-R

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 »

## Pair with minimum absolute difference after solving each query

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 »

## Iterative Segment Tree (Range Maximum Query with Node Update)

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 »

## Queries to find maximum product pair in range with updates

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… Read More »