## Maximum and minimum sums from two numbers with digit replacements

Given two positive numbers calculate the minimum and maximum possible sums of two numbers. We are allowed to replace digit 5 with digit 6 and… Read More »

## Partition a number into two divisble parts

Given a number (as string) and two integers a and b, divide the string in two non-empty parts such that the first part is divisible… Read More »

## Find element using minimum segments in Seven Segment Display

A Seven Segment Display can be used to to display numbers. Given an array of n natural numbers. The task is to find the number… Read More »

## Count natural numbers whose all permutation are greater than that number

There are some natural number whose all permutation is greater than or equal to that number eg. 123, whose all the permutation (123, 231, 321)… Read More »

## Count numbers with same first and last digits

Given an interval, the task is to count numbers which have same first and last digits. For example, 1231 has same first and last digits.… Read More »

## Find the highest occurring digit in prime numbers in a range

Given a range L to R, the task is to find the highest occurring digit in prime numbers lie between L and R (both inclusive).… Read More »

## Generate all palindromic numbers less than n

Find all numbers less than n, which are palindromic. Numbers can be printed in any order. Examples : Input : n = 12 Output :… Read More »

## Minimum sum of two numbers formed from digits of an array

Given an array of digits (values are from 0 to 9), find the minimum possible sum of two numbers formed from digits of the array.… Read More »

## Count digits in given number N which divide N

Given a number N which may be 10^5 digits long, the task is to count all the digits in N which divide N. Divisibility by… Read More »

An integer number in base 10 which is divisible by sum of it digits is said to be a Harshad Number. An n-harshad number is… Read More »

## Keith Number

A n digit number x is called Keith number if it appears in a special sequence (defined below) generated using its digits. The special sequence… Read More »

## Smallest number by rearranging digits of a given number

Find the Smallest number (Not leading Zeros) which can be obtained by rearranging the digits of given number. Examples: Input: n = 846903 Output: 304689… Read More »

## Sum of all numbers that can be formed with permutations of n digits

Given n distinct digits (from 0 to 9), find sum of all n digit numbers that can be formed using these digits. It is assumed… Read More »

## Count ways to spell a number with repeated digits

Given a string that contains digits of a number. The number may contain many same continuous digits in it. The task is to count number… Read More »

## Finding sum of digits of a number until sum becomes single digit

Given a number n, we need to find the sum of its digits such that: If n < 10 digSum(n) = n Else digSum(n) =… Read More »