← Back to challenges

YouTube Upload Count

JavaScriptHarddata_structuresloopsstrings

Instructions

You are given an array of dates in the format Dec 11 and a month in the format Dec as arguments. Each date represents a video that was uploaded on that day. Return the number of uploads for a given month.

Examples

uploadCount(["Sept 22", "Sept 21", "Oct 15"], "Sept") ➞ 2

uploadCount(["Sept 22", "Sept 21", "Oct 15"], "Oct") ➞ 1

Notes

If you only pay attention to the month and ignore the day, the challenge will become easier.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Perfect Roots