## Find a permutation of 2N numbers such that the result of given expression is exactly 2K

Given two integers N and K, the task is to find a permutation of first 2*N natural numbers such that the following equation is satisfied.… Read More »

## Check if a number can be represented as a sum of 2 triangular numbers

Given an integer N, the task is to find out whether it can be written as a sum of 2 triangular numbers (which may or… Read More »

## Smallest multiple of 3 which consists of three given non-zero digits

Given three non-zero digits 0 < A, B, C < 9. The task is to find the smallest number divisible by 3 all of whose… Read More »

## Natural Numbers

Counting numbers like 1, 2, 3, 4, 5, 6 … Basically, all integers greater than 0 are natural numbers. Fact about Natural numbers They are… Read More »

## Find the minimum positive integer such that it is divisible by A and sum of its digits is equal to B

Given two integers A and B, the task is to find the minimum positive integer N such that N is divisible by A and the… Read More »

## Find largest number smaller than N with same set of digits

Given a number N in the form of string. The task is to find the greatest number that has same set of digits as N… Read More »

## Sum of all even numbers in range L and R

Given two integers L and R, the task is to find the sum of all even numbers in range L and R. Examples: Input: L… Read More »

## Common prime factors of two numbers

Given two integer and , the task is to find the common prime divisors of these numbers. Examples: Input: A = 6, B = 12… Read More »

## Count pairs of numbers from 1 to N with Product divisible by their Sum

Given a number . The task is to count pairs (x, y) such that x*y is divisible by (x+y) and the condition 1 <= x… Read More »

## Find minimum operations needed to make an Array beautiful

Given a binary array( consider it as cyclic with start and end tied together) of length N having only one’s and zero’s where . The… Read More »

## Minimum number of cuts required to make circle segments equal sized

Given an array of elements where each element in the array represents the degree ( 0 <= a[i] <= 359 ) at which there is… Read More »

## Find permutation of n which is divisible by 3 but not divisible by 6

Given an integer . The task is to find another interger which is permutation of n, divisible by 3 but not divisible by 6. Given… Read More »

## Next greater Number than N with the same quantity of digits A and B

Given a number and two digits and . The task is to find the least number not less than N which contains the equal number… Read More »

## Count the number of carry operations required to add two numbers

Given two numbers, the task is to find the number of carry operations required when two numbers are added as below. 1234 + 5678 ——–… Read More »

## Program to find the Nth Harmonic Number

Given a number N. The task is to find the Nth Harmonic Number. Let the nth harmonic number be Hn. The harmonic series is as… Read More »