Given an integer array nums, return the length of the longest arithmetic subsequence in nums.
A subsequence is a sequence obtained from nums by deleting zero or more elements without altering the relative order of the remaining elements.
A sequence seq is arithmetic if the difference between any two consecutive elements is constant.
Constraints:
nums.length
nums[i]
Given an integer array nums, return the length of the longest arithmetic subsequence in nums.
A subsequence is a sequence obtained from nums by deleting zero or more elements without altering the relative order of the remaining elements.
A sequence seq is arithmetic if the difference between any two consecutive elements is constant.
Constraints:
nums.length
nums[i]