It took me much more time to solve this question than any other "Easy" problem.
I think that who ever classified this problem as easy made a mistake.
This is a medium level question. What makes this question harder, is the handling of 0.
Is this really an "easy" problem

Well, maybe I was lucky, but that one passed all tests and was marked as accepted.
public class Solution {
public int maxSubArrayLen(int[] nums, int k) {
int len = 0;
for (int i=0; i<nums.length; i++) {
int sum = 0;
for (int j=i; j<nums.length; j++) {
sum += nums[j];
if(sum == k) {
len = Math.max(len, ji+1);
}
}
}return len; }
}

Based on the comments below O(N^2) solution  doesn't get accepted  by this I am in noway implying the problem is hard or not :).
int maxSubArrayLen(vector<int>& nums, int k) { int len = nums.size(); if (len == 0) return 0; int maxLen = INT_MIN, steps = 0, sum = 0; for (int i = 0; i < len; ++i) { sum = nums[i]; for (int j = i + 1; j < len; ++j) { sum += nums[j]; if (sum == k) maxLen = max(maxLen, j  i + 1); } } return maxLen == INT_MIN ? 0 : maxLen; }