You are viewing a single comment's thread. Return to all comments →
C#
public static int birthday(List<int> s, int d, int m) { int currDays; int divisions = 0; for (int i = 0; i < s.Count() - (m-1); i++){ currDays = 0; for (int j = 0; j < m; j++){ currDays += s[i+j]; } if (currDays == d) divisions++; } return divisions; }
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 →
C#