Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. // Complete the birthday function below.
  2. static int birthday(List<int> s, int d, int m) {
  3. int n = 0;
  4. for(int i = 0; i < s.Count; i++) {
  5. if(s.Skip(i).Take(m).Sum() == d)
  6. n++;
  7. }
  8. return n;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement