## Program to find the Nth number of the series 2, 10, 24, 44, 70…..

Given a number N, the task is to find the Nth (N may be up to 10^18) term of this series: 2, 10, 24, 44,… Read More »

## Quotient – Remainder Sort

Quotient – Remainder Sort is a non-comparison based sorting algorithm. Steps to perform Quotient – Remainder sort as described below : Find MIN and MAX… Read More »

## Find the direction from given string

Given a string of containing only L’s and R’s which represents left rotation and right rotation respectively. The task is to find the final direction… Read More »

## Sum of Digits in a^n till a single digit

Given two numbers a and n, the task is to find the single sum of digits of a^n (pow(a, n)). In single digit sum, we… Read More »

## Minimum Players required to win the game

Given N questions and K options for each question, where and . The task is to determine sum of total number of player who has… Read More »

## Maximize the product of four factors of a Number

Given an integer N, the task is to find the maximum product of A, B, C, D such that below conditions satisfy: N%A ==0 &&… Read More »

## Program to find sum of the given sequence

Given two numbers and . The task is to find the sum of the sequence given below. (1*2*3*…*k) + (2*3*…*k*(k+1)) + (3*4*..*(k+1)*(k+2)) +…..+((n-k+1)*(n-k+2)*…*(n-k+k)). Since the… Read More »

## Minimum number of square tiles required to fill the rectangular floor

Given a rectanglular floor of (M X N) meters is to be paved with square tiles of (s X s). The task is to find… Read More »

## Print all substring of a number without any conversion

Given an integer N, the task is to print all the substring of N without doing any conversion i.e converting it into a string or… Read More »

## Modulo power for large numbers represented as strings

Given two numbers sa and sb represented as strings, find ab % MOD where MOD is 1e9 + 7. The numbers a and b can… Read More »

## Queries to count the number of unordered co-prime pairs from 1 to N

Given a number N. The task is to find the number of unordered coprime pairs of integers from 1 to N. There can be multiple… Read More »

## Find First element in AP which is multiple of given prime

Given the first term (A) and common difference (D) of an Arithmetic Progression, and a prime number (P). The task is to find the position… Read More »

## Modular exponentiation (Recursive)

Given three numbers a, b and c, we need to find (ab) % c Now why do “% c” after exponentiation, because ab will be… Read More »

## Sum of sum of all subsets of a set formed by first N natural numbers

Given N, and ff(N) = f(1) + f(2) + …… + f(N), where f(k) is the sum of all subsets of a set formed by… Read More »

## Program to find last two digits of 2^n

Given a number n, we need to find the last two digits of 2n. Examples: Input : n = 7 Output : 28 Input :… Read More »