You are viewing a single comment's thread. Return to all comments →
Here is my own java solution. Please rate if you don't mind. :)
public static int birthday(List s, int d, int m) {
int count = 0; for(int i = 0; i < s.size(); i++){ int squaresSum = 0; for(int j = 0; j < m; j++){ if(j+i < s.size()){ squaresSum += s.get(j+i); } } if(squaresSum == d){ count++; } } return count; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →
Here is my own java solution. Please rate if you don't mind. :)
public static int birthday(List s, int d, int m) {
}