parameters: (self, nums)
return_statement: return dp[-1]
docstring: :type nums: List[int]
          :rtype: bool
docstring_summary: :type nums: List[int]
          :rtype: bool
docstring_tokens: : type nums : List [ int ] : rtype : bool
function: def canPartition(self, nums):
          """
          :type nums: List[int]
          :rtype: bool
          """
          s = sum(nums)
          if s % 2:
              return False
  
          dp = [False] * (s/2 + 1)
          dp[0] = True
          for num in nums:
              for i in reversed(xrange(1, len(dp))):
                  if num <= i:
                      dp[i] = dp[i] or dp[i - num]
          return dp[-1]
function_tokens: def canPartition ( self , nums ) : s = sum ( nums ) if s % 2 : return False dp = [ False ] * ( s / 2 + 1 ) dp [ 0 ] = True for num in nums : for i in reversed ( xrange ( 1 , len ( dp ) ) ) : if num <= i : dp [ i ] = dp [ i ] or dp [ i - num ] return dp [ - 1 ]