We call decimal number a monotone if:
Write a program which takes positive number n on input and returns number of decimal numbers of length n that are strict monotone. Number can’t start with 0.
Input : 2 Output : 36 Numbers are 12, 13, ... 19, 23 24, ... 29, .... 89. Input : 3 Output : 84
Explanations of this problem follows the same rules as applied on:
Number of decimal numbers of length k, that are monotone
The only difference is that now we cannot take duplicates, so previously computed values are the one on the left and left top diagonal.
- Probability of reaching a point with 2 or 3 steps at a time
- K maximum sums of overlapping contiguous sub-arrays
- Counting numbers of n digits that are monotone
- Different ways to sum n using numbers greater than or equal to m
- Count of arrays having consecutive element with different values
- Number of ways to arrange N items under given constraints
- Value of continuous floor function : F(x) = F(floor(x/2)) + x
- Number of n-digits non-decreasing integers
- Temple Offerings
- Top 20 Dynamic Programming Interview Questions
- Find number of endless points
- Hexagonal Number
- Tiling Problem
- Longest Common Substring | DP-29
- Overlapping Subproblems Property in Dynamic Programming | DP-1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : manishshaw1