You are viewing a single comment's thread. Return to all comments →
Same approach in C#
int total = 0; for(int i = 0; i <= s.Count - m; i++) { var segsSum = s.GetRange(i, m).Aggregate((a, b) => a + b); if(segsSum == d) { total++; } } return total;
Subarray Division
You are viewing a single comment's thread. Return to all comments →
Same approach in C#