0
$\begingroup$

We are given a list $LIS$ of $n$ elements, $LIS_1, LIS_2,\ldots,LIS_n$. $LIS_i$ denotes the STIRCTLY longest increasing subsequence upto $i^\text{th}$ digit. We need to find the number of possible $n$-digit numbers whose $LIS$ list matches with the given list.
For example, number $1531$ has $n=4$ digits and its $LIS$ is $[1,2,2,1]$.

Ex: $n=1, LIS = [1]$
$\therefore $ possible 1-digit numbers would be $0,1,\ldots,9$. Hence answer is $10$.

  • 0
    I don't thing $LIS_3$ is always well defined, for example consider the list $1,3,2$.2017-01-22
  • 0
    Yes that is an invalid list. But otherwise the answer would be atleast 1. For proper given list, how shall I proceed?2017-01-22
  • 0
    Why is the last entry in our example $1$ ?2017-01-22

0 Answers 0