Skip to content

Commit cf444d6

Browse files
committed
Merge branch 'longArthSub' of https://github.com/tejaswi0910/Python into longArthSub
2 parents 427b1ca + fa1633b commit cf444d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: dynamic_programming/longest_arithmetic_subsequence.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
seq.length - 1).
1010
"""
1111

12+
1213
def longest_arithmetic_subsequence(nums: list[int]) -> int:
1314
"""
1415
Finds the length of the longest arithmetic subsequence in a given array of integers.
@@ -40,7 +41,7 @@ def longest_arithmetic_subsequence(nums: list[int]) -> int:
4041
"""
4142
if nums is None:
4243
raise ValueError("Input array cannot be None")
43-
44+
4445
if len(nums) == 0:
4546
return 0
4647

@@ -61,6 +62,7 @@ def longest_arithmetic_subsequence(nums: list[int]) -> int:
6162

6263
if __name__ == "__main__":
6364
import doctest
65+
6466
doctest.testmod()
6567
# Sample test case
6668
nums = [3, 6, 9, 12]

0 commit comments

Comments
 (0)