You are viewing a single comment's thread. Return to all comments →
public static int birthday(List<int> s, int d, int m) { int count = 0; for (int i = 0; i <= s.Count - m; i++) { int sum = 0; for (int c = 0; c < m; c++) { sum += s[i + c]; } if (sum == d) count++; } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division 1
You are viewing a single comment's thread. Return to all comments →