# Tag Archives: number-digits

## Count total number of digits from 1 to nJuly 6, 2017

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 integersJune 27, 2017

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 valueJune 23, 2017

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 numbersJune 17, 2017

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

## Find count of digits in a number that divide the number

Given a positive integer n. The task is to find count of digits of number which evenly divides the number n. Examples: Input : n… Read More »

## Find the occurrences of digit d in the range [0..n]June 15, 2017

Given a number n and a digit d, count all occurrences of d in range from 0 to n. Examples: Input : n = 25… Read More »

## Numbers having Unique (or Distinct) digitsJune 14, 2017

Given a range, print all numbers having unique digits. Examples: Input : 10 20 Output : 10 12 13 14 15 16 17 18 19… Read More »

## Sum of all substrings of a string representing a number | Set 2 (Constant Extra Space)June 12, 2017

Given a string representing a number, we need to get the sum of all possible sub strings of this string. Examples: Input : s =… Read More »

## Automorphic NumberJune 4, 2017

Given a number N, the task is to check whether the number is Automorphic number or not. A number is called Automorphic number if and… Read More »

## Find n-th element in a series with only 2 digits (4 and 7) allowed

Consider a series of numbers composed of only digits 4 and 7. First few numbers in the series are 4, 7, 44, 47, 74, 44744,..… Read More »

## Find the n-th number made of even digits onlyMay 27, 2017

Given a number n, find out the n-th positive number made up of even digits (0, 2, 4, 6, 8) only. Firs few numbers made… Read More »

## Given a number n, find the first k digits of n^nMay 16, 2017

Given a number n, find the first k digits of nn, where k is a value less than the number of digits in nn Input… Read More »

## Generate k digit numbers with digits in strictly increasing orderMay 14, 2017

Given a value k, generate all well ordered numbers of length k. Well ordered means that dig­its should be in increas­ing. Examples: Input : K… Read More »

## Pandigital number in a given baseMay 11, 2017

Given an integer n and its base b. The task is to check if given number is Pandigital Number in the given base or not.… Read More »

## Reverse digits of an integer with overflow handledMay 7, 2017

Write a C program to reverse an integer assuming that the input is a 32-bit integer. If the reversed integer overflows, print -1 as the… Read More »