A positive integer is called balanced if the size of its longest strictly decreasing subsequence (in its decimal expression) is the same as the size of its longest non-strictly increasing subsequence.
For example, the number $77429$ is balanced, because both its longest strictly decreasing subsequence ($742$) and its longest non-strictly increasing subsequence ($779$) have length $3$.
There are $2274$ balanced integers below $10^4$.
Find the total number of balanced integers. Give your answer modulo $10^9+7$.
Solution
No solution yet. Write yours at
solutions/s1004.md.