Number of non-decreasing functions? 
Let $A = \{1,2,3,\dots,10\}$ and $B = \{1,2,3,\dots,20\}$.
Find the number of non-decreasing functions from $A$ to $B$.

What  I tried:
Number of non-decreasing functions = (Total functions) - (Number of decreasing functions)
Total functions are $20^{10}$. And I think there are ${20 \choose 10}$ decreasing functions. Since you choose any $10$ codomain numbers and there's just one way for them to be arranged so that the resultant is a decreasing function.
However my answer doesn't match. Where am I going wrong?
How can I directly compute the non-decreasing functions like without subtracting from total?

Means Here function satisfy the following Condition.
$f(1),f(2),f(3),.......f(10)\in \left\{1,2,3,4,5,...,20\right\}$
$\; \bullet f(1)<f(2)<..........<f(10)\;,$ Total no. of possibilities $ = \displaystyle \binom{20}{10}$
$\;\bullet f(1)\leq f(2)<f(3)<.......<f(10)\;,$ Total no. of possibilities $\displaystyle \binom{20}{9}$
There are $9$ Such cases. So Total Possibilities for $\bf{2^{nd}}$ cases $ \displaystyle 9 \times \binom{20}{9}$
$\;\bullet\; f(1)\leq f(2)\leq f(3)<......,f(10)\;,$ Total cases $\displaystyle \binom{20}{8}$
These are $8$ such cases . So Total $\displaystyle 8\times \binom{20}{8}$
Similarly Calculate in that manner.
may be it helps to you.
Now We can add all possibilities , we get
$\displaystyle = \binom{20}{10}+9\times \binom{20}{9}+8\times \binom{20}{8}+........+1\times \binom{20}{1}$
$\displaystyle  = \underbrace{\binom{20}{10}+\binom{20}{9}}+8\left[\underbrace{\binom{20}{9}+\binom{20}{8}}\right]+..........+\binom{20}{1}$
$\displaystyle = \binom{21}{10}+8\times \binom{21}{9}+.....+\binom{20}{1}$
Above we have uese the formula $\displaystyle \binom{n}{r}+\binom{n}{r-1} = \binom{n+1}{r}$
Now Adding in similar manner, We get final answer $\displaystyle = \binom{29}{10}$
