# Tag Archives: number-digits

## Smallest N digit number with none of its digits as its divisor

Given an integer N. The task is to find the smallest N digit number S, such that S is not divisible by any of its… Read More »

## Count of N-digit numbers with absolute difference of adjacent digits not exceeding K

Given two integers N and K, the task is to find the count of N-digit numbers such that the absolute difference of adjacent digits in… Read More »

## How to check if string contains only digits in Java

Given a string str, the task is to write a Java program to check whether a string contains only digits or not. If so, then… Read More »

## Smallest number greater than Y with sum of digits equal to X

Given two integers X and Y, find the minimal number with the sum of digits X, which is strictly greater than Y. Examples: Input: X… Read More »

## Largest number made up of X and Y with count of X divisible by Y and of Y by X

Given three integers X, Y and N, the task is to find the largest number possible of length N consisting only of X and Y… Read More »

## Minimum count of numbers required with unit digit X that sums up to N

Given two integers N and X, the task is to find the minimum count of integers with sum N and having unit digit X. If… Read More »

## Count of numbers upto N digits formed using digits 0 to K-1 without any adjacent 0s

Given two integers N and K, the task is to count the numbers up to N digits such that no two zeros are adjacents and… Read More »

## Smallest number whose square has N digits

Given a number N, the task is to find the smallest number whose square has N digits. Examples: Input: N = 2 Output: 4 Explanation:… Read More »

## Count all prime numbers in a given range whose sum of digits is also prime

Given two integers L and R, the task is to find the count of total numbers of prime numbers in the range [L, R] whose… Read More »

## Find two numbers with sum N such that neither of them contains digit K

Given a number N and a digit K (1 < K <= 9), the task is to find two integers A and B such that… Read More »

## Min steps to convert N-digit prime number into another by replacing a digit in each step

Given two N-digit prime numbers A and B, the task is to find the minimum number of steps taken to convert A to B. Condition… Read More »

## Find all possible ways to Split the given string into Primes

Given a string str that represents a number. The task is to find all possible ways to split the given string such that each segment… Read More »

## Min number of operations to reduce N to 0 by subtracting any digits from N

Given a number N, the task is to find the minimum number of operations required to reduce the number N to zero by subtracting the… Read More »

## Place Value of a given digit in a number

Place value can be defined as the value represented by a digit in a number on the basis of its position in the number. Here… Read More »

## Self Numbers

A Number N is said to be Self Number if it can not be written as M + sum of digits of M for any… Read More »