Java Solution


  • 0
    R

    class Solution {
    public int findLengthOfLCIS(int[] nums) {
    if(nums.length==0) return 0;
    int m=1,n=0;
    for(int i=0;i<nums.length-1;i++){
    if(nums[i]<nums[i+1]) m++;
    else {if( m>n) n=m; m=1;}
    }
    if(m>n) n=m;
    return n;
    }
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.