title: Issue with finding the longest increasing sub sequence
body: <p>I wrote this method for finding the longest increasing sub sequence in an array. My question is, after checking if the next index is higher in the second <code>for</code> loop, why do I have to even use the <code>else</code> block afterwards? It doesn't output a correct result if I don't. Why wouldn't it just be sufficient to increment <code>currentSeq</code> by <code>1</code> if the next one in the sequence is bigger? If <code>false</code>, than just move on with the flow of control, with currentSeq being left at <code>1</code> anyway?            </p>
  
  <pre><code>static void Main(string[] args)
  {
      int length = int.Parse(Console.ReadLine());
      int[] nums = new int[length];
  
      int currentSeq = 1;
      int maxSeq = 1;
  
      for (int i = 0; i &lt; nums.Length; i++)
      {
          nums[i] = int.Parse(Console.ReadLine());
      }
  
      for (int i = 0; i &lt; nums.Length - 1; i++)
      {
          if (nums[i] &lt; nums[i + 1])
          {
              currentSeq++;
          }
          else
          {
              currentSeq = 1;
          }
  
          if (currentSeq &gt; maxSeq)
          {
              maxSeq = currentSeq;
          }
      }
  
      Console.WriteLine(maxSeq);
  }
  </code></pre>