  Showing: Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Total number of non-decreasing numbers with n digits
Easy Accuracy: 38.61% Submissions: 101 Points: 2

A number is non-decreasing if each of its digits is greater than or equal to the previous digit. For example, 223, 4455567, 899, are non-decreasing numbers.
Given an integer N, find the total number of non-decreasing numbers that have N digits.

Example 1:

Input: N = 1
Output: 10
Explaination: All the single digit numbers
are non-decreasing. So count is 10.

Example 2:

Input: N = 2
Output: 55
Explaination: For number starting with 1 there
is 1 decreasing number 10, for number starting
with 2 there are 2 decreasing numbers.
Similarly numbers starting with 3, 4 . . . 9
there are 3, 4 . . . 9 decreasing numbers.
Total 45 decreasing numbers. Total possible
numbers are 102 = 100. So total number of
non-decreasing numbers are 100-45 = 55.

You do not need to read input or print anything. Your task is to complete the function count() which takes the number N as input parameter and return the total number of non-decreasing numbers.

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)

Constraints:
1 ≤ N ≤ 500

### Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

#### My Submissions:  