maxLength
: 증가하는 subArray 요소의 최대 길이curLength
: 증가하는 subArray 현재 길이curGap
: 현재 요소와 이전 요소의 차curLength
를 증가시키며 최대 길이와 비교function findLengthOfLCIS(nums: number[]): number {
let maxLength = 1
let curLength = 1
for(let i = 1; i < nums.length; i++) {
const curGap = nums[i] - nums[i - 1]
if(curGap <= 0) {
curLength = 1
continue
}
curLength++
maxLength = Math.max(maxLength, curLength)
}
return maxLength
};