## Count of numbers from range [L, R] that end with any of the given digits

Given a range [L, R], the task is to find the count of numbers from the range whose last digit is either 2, 3 or… Read More »

## Minimum K such that sum of array elements after division by K does not exceed S

Given an array arr[] of N elements and an integer S. The task is to find the minimum number K such that the sum of… Read More »

## Longest substring with K unique characters using Binary Search

Given a string str and an integer K, the task is to print the length of the longest possible substring that has exactly K unique… Read More »

## Value to be subtracted from array elements to make sum of all elements equals K

Given an integer K and an array height[] where height[i] denotes the height of the ith tree in a forest. The task is to make… Read More »

## Check if given string contains all the digits

Given a string str consisting of alphanumeric characters, the task is to check whether the string contains all the digits from 1 to 9. Examples:… Read More »

## Check if a symmetric plus is possible from the elements of the given array

Given an array arr[] of N elements, the task is to check whether a symmetric plus is possible with the elements of the given array.… Read More »

## Queries for elements greater than K in the given index range using Segment Tree

Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R and K. For each… Read More »

## Calculate the Sum of GCD over all subarrays

Given an array of integers, the task is to calculate the sum of GCD of all the subarrays of an array. GCD of an array… Read More »

## Count of quadruplets with given sum | Set 3

Given four arrays containing integer elements and an integer sum, the task is to count the quadruplets such that each element is chosen from a… Read More »

## Largest area square in an array when elements can be shuffled

Given an array arr[] of N integers where arr[i] is the height of the ith chocolate and all the chocolated are 1 unit wide, the… Read More »

## Check if the bracket sequence can be balanced with at most one change in the position of a bracket | Set 2

Given a bracket sequence as a string str, the task is to find whether the given string can be balanced by moving at most one… Read More »

## Count of triplets in an array that satisfy the given conditions

Given an array arr[] of N elements, the task is to find the count of triplets (arr[i], arr[j], arr[k]) such that (arr[i] + arr[j] +… Read More »

## Check if any K ranges overlap at any point

Given N ranges [L, R] and an integer K, the task is to check if there are any K ranges which overlap at any point.… Read More »

## Kth number from the set of multiples of numbers A, B and C

Given four integers A, B, C and K. Assume that all the multiples of A, B and C are stored in a set in sorted… Read More »

## Find next greater element with no consecutive 1 in it’s binary representation

Given Q queries where each query consists of an integer N and the task is to find the smallest integer greater than N such that… Read More »