```
def maxSubArrayLen(self, nums, k):
rs={}
sum=0
maxL=0
for i in range(len(nums)):
sum+=nums[i]
rs[sum]=i
for i in range(len(nums)):
j=rs.get(k,None)
if j != None and j-i+1 > maxL:
maxL=j-i+1
k+=nums[i]
return maxL
```