Longest Arithmetic Subsequence of Given Difference
Find the longest subsequence whose consecutive elements differ by a fixed given step. The visual extends chains while a lookup table keeps the best length ending at each value.
Find the longest subsequence whose consecutive elements differ by a fixed given step. The visual extends chains while a lookup table keeps the best length ending at each value.