Here is the code:
class Solution {
public int findLengthOfLCIS(int[] nums) {
if(nums.length==0)
{
return 0;
}
int max = 0;
int count=0;
for(int i =0;i<nums.length-1;i++)
{
if(nums[i]<nums[i+1])
{
count++;
}
else
{
count=0;
}
max = max>count?max:count;
}
return max+1;
}
}
Your go-to destination for mastering software development technologies, data structures, and algorithms in an easy-to-understand way!
Popular Posts
-
Here is the Code: class Program { static void Main(string[] args) { Quene q = new Quene(); // This...
-
Here is the code: class Program { static List<int> li = new List<int>(); static void Main(string[] args...
-
Here is the code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; ...