LeetCode
Longest Arithmetic Sequence
Click
here
for an explanation.