mirror of
https://github.com/TheAlgorithms/C
synced 2025-04-22 05:06:12 +03:00
21 lines
388 B
C
21 lines
388 B
C
int findLengthOfLCIS(int *nums, int numsSize)
|
|
{
|
|
int maxval = 1, i, count = 1;
|
|
if (numsSize == 0)
|
|
return 0;
|
|
for (i = 1; i < numsSize; i++)
|
|
{
|
|
if (nums[i] > nums[i - 1])
|
|
{
|
|
count++;
|
|
if (count >= maxval)
|
|
maxval = count;
|
|
}
|
|
else
|
|
{
|
|
count = 1;
|
|
}
|
|
}
|
|
return maxval;
|
|
}
|