## 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 »

- How can one become good at Data structures and Algorithms easily?
- Understanding The Coin Change Problem With Dynamic Programming
- Subset array sum by generating all the subsets
- Make all numbers of an array equal
- Reach the numbers by making jumps of two given lengths
- Some useful C++ tricks for beginners in Competitive Programming
- Check if a number is perfect square without finding square root
- Sum of XOR of all subarrays
- Sum of the first N Prime numbers
- Sort the array of strings according to alphabetical order defined by another string
- Sum of similarities of string with all of its suffixes
- Length of the longest Subarray with only Even Elements
- Check if it is possible to reach a number by making jumps of two given length
- Find the number in a range having maximum product of the digits
- Make Binary Search Tree
- Print matrix in snake pattern from the last column
- Maximum of all Subarrays of size k using set in C++ STL
- Smallest Pair Sum in an array
- Number of array elements derivable from D after performing certain operations
- Count distinct substrings that contain some characters at most k times
- Minimum number of sets with numbers less than Y
- Count the number of vowels occurring in all the substrings of given string
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Operations required to make the string empty
- Find two numbers whose divisors are given in a random order
- Sum of the multiples of two numbers below N
- Number of subarrays have bitwise OR >= K
- Remove characters from a numeric string such that string becomes divisible by 8
- Program to find the kth character after decrypting a string
- Maximum length substring with highest frequency in a string

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 integer N. The following tasks are performed: The number is noted. The leading digit from N is subtracted from N and the resulting… Read More »

Given two integers A and B, the task is to calculate 22A % B. Examples: Input: A = 3, B = 5 Output: 1 223… Read More »

Given an array arr[] of size N and an integer K, the task is to find the smallest index in the array such that: floor(arr[i]… Read More »

Given three integers X, N and M. The task is to find XXX…(N times) % M where X can be any digitfrom the range [1,… Read More »

Given an integer Y, find the smallest number X such that X! contains at least Y trailing zeros. Prerequisites – Count trailing zeroes in factorial… Read More »

Given a number N. Find the number of ways to divide a number into four parts(a, b, c, d) such that a = c and… Read More »

Given a range of positive integers from l to r. Find such a pair of integers (x, y) that l <= x, y <= r,… Read More »

Given 2 integers L and R, the task is to find out the number of integers in the range [L, R] such that they are… Read More »

Given an array of size n, the task is to find the minimum number of steps required to make all the elements of the array… Read More »

Given two N X M matrices of integers. In an operation, we can transpose any square sub-matrix in matrix1. The task is to check if… Read More »

Given a generic digital clock, having h number of hours and m number of minutes, the task is to find how many times the clock… Read More »

Given the position of the queen (qX, qY) and the opponent (oX, oY) on a chessboard. The task is to determine whether the queen can… Read More »

Given two arrays of N integers. Consider an array C, where the i-th integer will be d*a[i] + b[i] where d is any arbitrary real… Read More »

Given an array of N integers and an integer K. The task is to print the maximum number of pairs(a[i]+a[j]) possible which are divisible by… Read More »