• 문제 링크
Longest Continuous Increasing Subsequence - LeetCode
Can you solve this real interview question? Longest Continuous Increasing Subsequence - Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be strictly increasin
leetcode.com
• 풀이 코드
public class Solution {
public int findLengthOfLCIS(int[] nums) {
int max = 1, cur = 1;
for (int i = 1; i < nums.length; i++) {
if (nums[i - 1] < nums[i]) max = Math.max(max, ++cur);
else cur = 1;
}
return max;
}
}'Problem Solving > LeetCode' 카테고리의 다른 글
| [LeetCode] 682. Baseball Game - Java (0) | 2026.09.23 |
|---|---|
| [LeetCode] 680. Valid Palindrome II - Java (0) | 2026.09.22 |
| [LeetCode] 671. Second Minimum Node In a Binary Tree - Java (0) | 2026.09.20 |
| [LeetCode] 661. Image Smoother - Java (0) | 2026.09.19 |
| [LeetCode] 657. Robot Return to Origin - Java (0) | 2026.09.18 |
댓글