Orders per Month
orders has a column date written like "2024-03-15". Return a dictionary mapping each month, written as "2024-03" (year-month), to the number of orders in that month. Only months with orders appear.
Example 1
orders {"date":["2024-03-15","2024-03-01","2024-04-02"]}
returns {"2024-03":2,"2024-04":1}
2024-03 has 2 orders and 2024-04 has 1.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.