You are viewing a single comment's thread. Return to all comments →
TypeScript ugly one-liner:
function birthday(s: number[], d: number, m: number): number { return s.flatMap((_, i) => [s.slice(i, m + i)]).filter((arr) => arr.reduce((a, b) => a + b, 0) === d).length; }
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 →
TypeScript ugly one-liner: