## Count of N-digit numbers in base K with no two consecutive zeroes

Given two integers N and K, the task is to find the count of all the integer in base K which satisfy the following conditions:… Read More »

## Count numbers in given range such that sum of even digits is greater than sum of odd digits

Given two integers L and R denoting a range [L, R]. The task is to find the total count of numbers in the given range… Read More »

## Number of n digit stepping numbers | Space optimized solution

Given n, find count of n digit Stepping numbers. A number is called stepping number if all adjacent digits have an absolute difference of 1.… Read More »

## Longest subsequence such that adjacent elements have at least one common digit

Given an array arr[] of N integers, the task is to find the length of the longest sub-sequence such that adjacent elements of the sub-sequence… Read More »

## Count Numbers in Range with difference between Sum of digits at even and odd positions as Prime

Given a range [L, R]. The task is to count the numbers in the range having difference between the sum of digits at even position… Read More »

## Count of numbers between range having only non-zero digits whose sum of digits is N and number is divisible by M

Given a range [L, R] and two positive integers N and M. The task is to count the numbers in the range containing only non-zero… Read More »

## Count of Numbers in a Range divisible by m and having digit d in even positions

Given a range represented by two positive integers l and r and two integers d and m. Find the count of numbers lying in the… Read More »

## Count of Numbers in Range where the number does not contain more than K non zero digits

Given a range represented by two positive integers L and R and a positive integer K. Find the count of numbers in the range where… Read More »

## Count of Numbers in a Range where digit d occurs exactly K times

Given two positive integers L and R which represents a range and two more positive integers d and K. The task is to find the… Read More »

## Count of Numbers in Range where first digit is equal to last digit of the number

Given a range represented by two positive integers L and R. Find the count of numbers in the range where the first digit is equal… Read More »

## Digit DP | Introduction

Prerequisite : How to solve a Dynamic Programming Problem ? There are many types of problems that ask to count the number of integers ‘x‘… Read More »