Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Complete the birthday function below.
- static int birthday(List<int> s, int d, int m) {
- int n = 0;
- for(int i = 0; i < s.Count; i++) {
- if(s.Skip(i).Take(m).Sum() == d)
- n++;
- }
- return n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement