From 427b1ca6855ffff0f07a1d320a54b8e7b513a654 Mon Sep 17 00:00:00 2001 From: Tejaswi Tyagi <98461855+tejaswi0910@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:56:50 +0000 Subject: [PATCH] ruff check fixes --- .../longest_arithmetic_subsequence.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dynamic_programming/longest_arithmetic_subsequence.py b/dynamic_programming/longest_arithmetic_subsequence.py index 4a19af504..74cb11b0b 100644 --- a/dynamic_programming/longest_arithmetic_subsequence.py +++ b/dynamic_programming/longest_arithmetic_subsequence.py @@ -1,10 +1,12 @@ """ -Longest Arithmetic Subsequence Problem: Given an array nums of integers, return the length of the longest arithmetic subsequence in nums. +Longest Arithmetic Subsequence Problem: Given an array nums of integers, return the length +of the longest arithmetic subsequence in nums. Note that: -- A subsequence is an array that can be derived from another array by deleting some or no elements - without changing the order of the remaining elements. -- A sequence seq is arithmetic if seq[i + 1] - seq[i] are all the same value (for 0 <= i < seq.length - 1). +- A subsequence is an array that can be derived from another array by deleting some or no + elements without changing the order of the remaining elements. +- A sequence seq is arithmetic if seq[i + 1] - seq[i] are all the same value (for 0 <= i < + seq.length - 1). """ def longest_arithmetic_subsequence(nums: list[int]) -> int: @@ -60,7 +62,7 @@ def longest_arithmetic_subsequence(nums: list[int]) -> int: if __name__ == "__main__": import doctest doctest.testmod() - # sample test case + # Sample test case nums = [3, 6, 9, 12] expected_length = 4