Order Number per Customer
orders has a column customer (text), and rows are in the order the orders were placed. Give every row its position among that customer's orders: 1 for their first order, 2 for their second, and so on. Return the list of positions in row order.
Example 1
orders {"customer":["ann","bo","ann","ann"]}
returns [1,1,2,3]
ann: 1, 2, 3. bo: 1. In row order: 1, 1, 2, 3.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.