## Find smallest permutation of given number

Given a long integer, return the smallest(magnitude) integer permutation of that number. Examples: Input : 5468001 Output : 1004568 Input : 5341 Output : 1345… Read More »

## Minimum number with digits as 4 and 7 only and given sum

Lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. What minimum lucky number has the sum of… Read More »

## Find maximum number that can be formed using digits of a given number

Given a number, write a program to find a maximum number that can be formed using all of the digits of this number. Examples: Input… Read More »

## Reverse a number using stack

Given a number , write a program to reverse this number using stack. Examples: Input : 365 Output : 563 Input : 6899 Output :… Read More »

## Form the largest number using at most one swap operation

Given a non-negative number num. The problem is to apply at most one swap operation on the number num so that the resultant is the… Read More »

## n-th number with digits in {0, 1, 2, 3, 4, 5}

Given a number n and we have to find n-th number such that it’s digits only consist 0, 1, 2, 3, 4 or 5. Examples… Read More »

## Arrange given numbers to form the biggest number | Set 2

Given an array of non-negative numbers(of Integer Range), they are needed to be arranged in some order such that it gives the max number. For… Read More »

## Number of times a number can be replaced by the sum of its digits until it only contains one digit

Count the number of times a number can be replaced by the sum of its digits until it only contains one digit and number can… Read More »

## Get the kth smallest number using the digits of the given number

Given a non-negative number n and a value k. Find the kth smallest number that can be formed using the digits of the given number… Read More »

## Print last k digits of a^b (a raised to power b)

Given positive integers k, a and b we need to print last k digits of a^b ie.. pow(a, b). Input Constraint: k <= 9, a… Read More »

## Nth Even length Palindrome

Given a number n as string, find the nth even-length positive palindrome number . Examples: Input : n = “1” Output : 11 1st even-length… Read More »

## Count total number of digits from 1 to n

Given a number n, count the total number of digits required to write all numbers from 1 to n. Examples: Input : 13 Output :… Read More »

## Number of n-digits non-decreasing integers

Given an integer n > 0, which denotes the number of digits, the task to find total number of n-digit positive integers which are non-decreasing… Read More »

## Count numbers with difference between number and its digit sum greater than specific value

Given a positive value N, we need to find the count of numbers smaller than N such that the difference between the number and sum… Read More »

## First digit in product of an array of numbers

Given an array of ‘n’ numbers. We need to find the first digit of product of these ‘n’ numbers Examples : Input : arr[] =… Read More »