[Solved] Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
Question Given an array nums of integers, return the length of the longest arithmetic subsequence in nums. Recall that a subsequence of an array nums is a list nums[i1], nums[i2], …, nums[ik] with 0 <= i1 < i2 < … < ik <= nums.length – 1, and that a sequence seq is arithmetic if seq[i+1] – seq[i] are all the same value (for 0 <= i < seq.length – 1). Example 1: Input: nums = [3,6,9,12] Output: […]