Arithmetic Slices II - Subsequence(LeetCode 446):

Problem