Counting the number of increasing sub-sequences
\$\newcommand{\sub}[1]{\text{sub}_{#1}}\$
This is more of an alternative algorithm than a review on your code (at least for now), but it seems like both could be helpful.

A good algorithm results from solving a slightly more informative version of the problem, which is simpler to decompose:


  \$\sub{s}^n\$ is the number of subsequences of \$s\$ that are ordered and end with the digit \$n\$.


\$\sub{s}\$ can be stored in a 10-long array, the sum of which solves your original problem:

$$
\left[\ \sub{s}^0;\ \text{sub}_s^1;\ \text{sub}_s^2;\ \ldots;\ \text{sub}_s^9\ \right]
$$

Clearly, for the empty string \$\varnothing\$, we have

$$
\text{sub}_\varnothing = \left[\ 0;\ 0;\ 0;\ \ldots;\ 0\ \right]
$$

The interesting trick is that extending a string \$s\$ with digit \$d\$ is a simple update

$$
\sub{sd}^n =
\begin{cases}
\sub{s}^n &amp; \text{if}\;n \ne d\\
1 + \sum_{i=0}^{n} \sub{s}^i &amp; \text{if}\;n = d
\end{cases}
$$

as the paths for subsequences that don't end in \$d\$ are unchanged and the subsequences that do end in \$d\$ are \$d\$ itself, \$d\$ added to the end of any prior subsequence that ends in a digit less than \$d\$, or any of the prior subsequences that did end with the digit already.