Skip to content

Commit 61b0e11

Browse files
committed
formatting
1 parent 9698034 commit 61b0e11

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

longest-consecutive-sequence/mrlee7.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import List
22

3-
43
"""
54
Ideation:
65
배열을 정렬한 뒤, 인접한 숫자들을 비교하면서 가장 긴 연속 수열의 길이를 구한다.
@@ -12,6 +11,8 @@
1211
Time Complexity: O(n log n)
1312
Space Complexity: O(1)
1413
"""
14+
15+
1516
class Solution:
1617

1718
def longestConsecutive(self, nums: List[int]) -> int:
@@ -32,4 +33,4 @@ def longestConsecutive(self, nums: List[int]) -> int:
3233
longest = max(longest, length)
3334
length = 1
3435
longest = max(longest, length)
35-
return longest
36+
return longest

0 commit comments

Comments
 (0)