Number of n-digits non-decreasing integers

Revision en1, by Dhanadeepa_Red, 2017-09-28 23:41:28

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 in nature.

A non-decreasing integer is a one in which all the digits from left to right are in non-decreasing form. ex: 1234, 1135, ..etc.

Note :Leading zeros also count in non-decreasing integers such as 0000, 0001, 0023, etc are also non-decreasing integers of 4-digits.

Examples:

Input : n = 1

Output : 10

Numbers are 0, 1, 2, ...9.

Input : n = 2

Output : 55

Input : n = 4

Output : 715

where n<10^3

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Dhanadeepa_Red 2017-09-28 23:41:28 620 Initial revision (published)