Skip to content

Commit 6a891c2

Browse files
authored
easy peasy
1 parent 9b939f7 commit 6a891c2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution(object):
2+
def findLengthOfLCIS(self, nums):
3+
if not nums:
4+
return 0
5+
count, ans = 1, 1
6+
for i in range(1, len(nums)):
7+
if nums[i] > nums[i-1]:
8+
count += 1
9+
else:
10+
if ans < count:
11+
ans = count
12+
count = 1
13+
return max(ans, count)

0 commit comments

Comments
 (0)