## Queries to return the absolute difference between L-th smallest number and the R-th smallest number

Given an array arr[] of N unique elements and Q queries. Every query consists of two integers L and R. The task is to print… Read More »

- Queries to check whether a given digit is present in the given Range
- Find the Initial Array from given array after range sum queries
- Find maximum points which can be obtained by deleting elements from array
- Find the missing elements from 1 to M in given N ranges | Set-2
- Two equal sum segment range queries
- Queries to check if a number lies in N ranges of L-R
- Count numbers in a range that are divisible by all array elements
- Print matrix after applying increment operations in M ranges
- Queries for Composite numbers in subarray (With Point Updates)
- Sum of even values and update queries on an array
- Sum of all odd length palindromic numbers within the range [L, R]
- Find the missing elements from 1 to M in given N ranges
- Count number of indices such that s[i] = s[i+1] : Range queries
- Maximum occurred integer in n ranges | Set-2
- Search an element in given N ranges
- Maximize the summation of numbers in a maximum of K moves in range [L, R]

Given an array arr[] of N unique elements and Q queries. Every query consists of two integers L and R. The task is to print… Read More »

Given an array of N sorted ranges and a number K. The task is to find the index of the range in which K lies.… Read More »

Given an array arr[] of N integers and Q queries. Each query consists of 3 integers L, R and K. You can move from index… Read More »

Given an array arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… Read More »

Given an array arr[] of integers and an array q[] of queries. For the ith query, index = q[i][0] and value = q[i][1]. The task… Read More »

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 »

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

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 »

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 »

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