## 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 »

## Finding number of digits in n’th Fibonacci number

Given a number n, find number of digits in n’th Fibonacci Numbers. First few Fibinacci numbers are 0, 1, 1, 2, 3, 5, 8, 13,… Read More »

## Count digit groupings of a number with given constraints

We are given a string consisting of digits, we may group these digits into sub-groups (but maintaining their original order). The task is to count… Read More »

## K’th Boom Number

Boom numbers are numbers consisting only of digits 2 and 3. Given an integer k (0<k<=10^7) , display the k-th Boom number. Examples: Input :… Read More »

## Print all n-digit numbers with absolute difference between sum of even and odd digits is 1

Given number of digits n, print all n-digit numbers whose absolute difference between sum of digits at even and odd positions is 1. Solution should… Read More »

## Print all n-digit numbers whose sum of digits equals to given sum

Given number of digits n, print all n-digit numbers whose sum of digits adds upto given sum. Solution should not consider leading 0’s as digits.… Read More »

## Count digits in a factorial | Set 2

Given an integer n (can be very large), find the number of digits that appear in its factorial, where factorial is defined as, factorial(n) =… Read More »

## Count digits in a factorial | Set 1

Given an integer n, find the number of digits that appear in its factorial, where factorial is defined as, factorial(n) = 1*2*3*4……..*n and factorial(0) =… 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 »

## Find all strings formed from characters mapped to digits of a number

Consider below list where each digit from 1 to 9 maps to few characters. 1 -> [‘A’, ‘B’, ‘C’] 2 -> [‘D’, ‘E’, ‘F’] 3… Read More »

## Find the Largest number with given number of digits and sum of digits

How to find the largest number with given digit sum s and number of digits d? Examples: Input : s = 9, d = 2… Read More »

## Find smallest number with given number of digits and sum of digits

How to find the smallest number with given digit sum s and number of digits d? Examples : Input : s = 9, d =… Read More »

## Count positive integers with 0 as a digit and maximum ‘d’ digits

Given a number d, representing the number of digits of a number. Find the total count of positive integers which have at-least one zero in… Read More »

## Print all Good numbers in given range

Given a digit ‘d’ and a range [L, R] where L < R, print all good numbers in given range that don't contain digit 'd'.… Read More »

## Print individual digits as words without using if or switch

Given a number, print words for individual digits. It is not allowed to use if or switch. Examples: Input: n = 123 Output: One Two… Read More »