title: Number of Longest increasing subsequence
body: <p>I need to return the number of <code>LIS</code> of the array.</p>
  
  <p>Pseudocode example:</p>
  
  <pre><code>if the arr is
   int []arr = {2,4,90,-3,-2,-1,-10,-9,-8};
  num of LIS is: 3
   2,4,90
   -3,-2,-1
   -10,-9,-8
  </code></pre>
  
  <p>example 2:</p>
  
  <pre><code>arr [] = {2,-3,4,90,-2,-1,-10,-9,-8};
  num of LIS is: 4
  2,4,90
  -3,4,90
  -3,-2,-1
  -10,-9,-8
  </code></pre>
  
  <p>I have tried to do this:</p>
  
  <pre><code>int [] A = {2,4,90,-3,-2,-1,-10,-9,-8};
      int[] dp = new int[A.length];
  
      for (int i = 0; i &lt; A.length; i++) {
          dp[i] = 1;
  
          for (int j = 0; j &lt;= i - 1; j++) {
              if (A[j] &lt; A[i]) {
                  dp[i] = dp[i] + dp[j];
              }
          }
          System.out.println(dp[dp.length - 1] ) ;
      }
  </code></pre>