parameters: (self, A)
return_statement: return max(dp.values())+1
docstring: :type A: List[int]
          :rtype: int
docstring_summary: :type A: List[int]
          :rtype: int
docstring_tokens: : type A : List [ int ] : rtype : int
function: def longestArithSeqLength(self, A):
          """
          :type A: List[int]
          :rtype: int
          """
          dp = collections.defaultdict(int)
          for i in xrange(len(A)-1):
              for j in xrange(i+1, len(A)):
                  v =  A[j]-A[i]
                  dp[v, j] = max(dp[v, j], dp[v, i]+1)
          return max(dp.values())+1
function_tokens: def longestArithSeqLength ( self , A ) : dp = collections . defaultdict ( int ) for i in xrange ( len ( A ) - 1 ) : for j in xrange ( i + 1 , len ( A ) ) : v = A [ j ] - A [ i ] dp [ v , j ] = max ( dp [ v , j ] , dp [ v , i ] + 1 ) return max ( dp . values ( ) ) + 1