You are viewing a single comment's thread. Return to all comments →
c# Solution:
public static int birthday(List<int> s, int d, int m) { int possibleCombinations = 0; for(int i=0; i<s.Count; i++) { if((s.Count) - i < m) break; if(s.GetRange(i, m).Sum(e => e) == d) { possibleCombinations++; } } return possibleCombinations; }
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# Solution: