## Sum of Fibonacci Numbers in a range

Given a range [l, r], the task is to find the sum fib(l) + fib(l + 1) + fib(l + 2) + ….. + fib(r)… Read More »

## Replace all elements by difference of sums of positive and negative numbers after that element

Given an array of positive and negative elements. The task is to replace every i-th element of the array by the absolute difference of absolute… Read More »

## Number of ways of scoring R runs in B balls with at most W wickets

Given three integers R, B and W which denote the number of runs, balls and wickets. One can score 0, 1, 2, 3, 6 or… Read More »

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

## Largest number N which can be reduced to 0 in K steps

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 »

## Find 2^(2^A) % B

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

## Smallest index in the given array that satisfies the given condition

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 »

## Find the value of XXXX…..(N times) % M where N is large

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 »

## Find the smallest number X such that X! contains at least Y trailing zeros.

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 »

## Find the number of ways to divide number into four parts such that a = c and b = d

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 »

## Find a distinct pair (x, y) in given range such that x divides y

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 »

## Count integers in a range which are divisible by their euler totient value

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 »

## Minimum steps to make all the elements of the array divisible by 4

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 »

## Check if matrix can be converted to another matrix by transposing square sub-matrices

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 »

## Count how many times the given digital clock shows identical digits

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 »