## Queries for number of distinct elements in a subarray | Set 2

Given an array arr[] of N integers and Q queries. Each query can be represented by two integers L and R. The task is to… Read More »

- Kth smallest element in a subarray
- XOR of all the elements in the given range [L, R]
- Range Queries to Find number of sub-arrays with a given xor
- Two equal sum segment range queries
- Count of quadruplets from range [L, R] having GCD equal to K
- Queries to update a given index and find gcd in range
- Queries to check whether all the elements can be made positive by flipping signs exactly K times
- Queries to find the last non-repeating character in the sub-string of a given string
- Queries for bitwise AND in the index range [L, R] of the given array
- Sum of even values and update queries on an array
- Maximum length palindrome that can be created with characters in range L and R
- Queries for bitwise OR in the index range [L, R] of the given array
- Search an element in given N ranges
- Queries to return the absolute difference between L-th smallest number and the R-th smallest number
- Maximize the summation of numbers in a maximum of K moves in range [L, R]
- Queries for number of distinct elements in a subarray | Set 2

Given an array arr[] of N integers and Q queries. Each query can be represented by two integers L and R. The task is to… Read More »

Given an array arr of size N. The task is to find the kth smallest element in the subarray(l to r, both inclusive). Note :… Read More »

Given an integer array arr[], and some queries consisting of an integer K, the task is to determine if its possible to make all the… Read More »

Given a string str, the task is to answer Q queries where every query consists of two integers L and R and we have to… Read More »

Given an array arr[] of N and Q queries consisting of a range [L, R]. the task is to find the bit-wise AND of all… Read More »

Given an array arr[] of N and Q queries consisting of a range [L, R]. the task is to find the bit-wise OR of all… Read More »

Given an integer K and a range [L, R], the task is to count the quadruplet pairs from the given range having gcd equal to… Read More »

Given a string str and Q queries. Each query consists of two numbers L and R. The task is to find the maximum length palindrome… Read More »

Given an array arr[] of N integers and queries Q. Queries are of two types: Update a given index ind by X. Find the gcd… Read More »

Given an array arr[] of size n and q queries and an integer k. Each query consists of an index range [l, r] and the… Read More »

Given a range [L, R], the task is to find the XOR of all the integers in the given range i.e. (L) ^ (L +… Read More »

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 »