## Ways to paint N paintings such that adjacent paintings don’t have same colors

Given two integers n and m, where n represent some paintings numbered from 1 to n and m represent some colours 1 to m with… Read More »

## Print all integers that are sum of powers of two given numbers

Given three non-negative integers x, y and bound, the task is to print all the powerful integer ≤ bound in sorted order. A powerful integer… Read More »

## Minimum removals in a number to be divisible by 10 power raised to K

Given two positive integers N and K. Find the minimum number of digits that can be removed from the number N such that after removals… Read More »

## Power in Mathematics

The power of a number says how many times to use the number in a multiplication. Powers are also called Exponents or Indices. For example,… Read More »

## Larger of a^b or b^a (a raised to power b or b raised to power a)

Given two numbers , find which is greater . If , print a^b is greater If , print b^a is greater If , print Both… Read More »

## Find the multiple of x which is closest to a^b

Given three integers a, b and x, the task is to get the multiple of x which is closest to ab. Examples: Input: a =… Read More »

## Total number of subsets in which the product of the elements is even

Given an array arr[] of integer elements, the task is to find the total number of sub-sets of arr[] in which product of the elements… Read More »

## Sum of first N natural numbers which are not powers of K

Given two integers and , the task is to find the sum of all the numbers within the range [1, n] excluding the numbers which… Read More »

## GCD of a number raised to some power and another number

Given three numbers a, b, n. Find GCD(an, b). Examples: Input : a = 2, b = 3, n = 3 Output : 1 2^3… Read More »

## Largest N digit number divisible by given three numbers

Given four integers x, y, z and n, the task is to find the largest n digit number which is divisible by x, y and… Read More »

## Find maximum value of x such that n! % (k^x) = 0

Given two integers and . The task is to find the maximum value of x, such that, n! % (k^x) = 0. Examples: Input :… Read More »

## Check if any permutation of N equals any power of K

Given a positive integer N and K where and . The task is to check whether any permutation of digits of N equals any power… Read More »

## All possible numbers of N digits and base B without leading zeros

Given number of digits ‘N’ and base ‘B’, the task is to count all the ‘N’ digit numbers without leading zeros that are in base… Read More »

## Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two

Given an array of N elements. The task is to count unordered pairs (i, j) in the array such that the product of a[i] and… Read More »

## Sum of first N natural numbers by taking powers of 2 as negative number

Given a number N ( maybe up to 10^9 ). The task is to find the sum of first N natural number taking powers of… Read More »