Loading problem...
A payments intelligence team wants to identify customers with the strongest day-by-day transaction consistency.
Table: Transactions
Data guarantee:
Streak definition:
Task: Return all customer IDs whose longest streak length is the highest among all customers.
Output requirements:
Important note:
Supported submission environments:
Transactions:
| transaction_id | customer_id | transaction_date | amount |
|----------------|-------------|------------------|--------|
| 1 | 101 | 2023-05-01 | 100 |
| 2 | 101 | 2023-05-02 | 150 |
| 3 | 101 | 2023-05-03 | 200 |
| 4 | 102 | 2023-05-01 | 50 |
| 5 | 102 | 2023-05-03 | 100 |
| 6 | 102 | 2023-05-04 | 200 |
| 7 | 105 | 2023-05-01 | 100 |
| 8 | 105 | 2023-05-02 | 150 |
| 9 | 105 | 2023-05-03 | 200 |[
{"customer_id":101},
{"customer_id":105}
]Customers 101 and 105 each have a longest streak of 3 consecutive days. Customer 102 has a best streak of 2 days, so it is not selected.
Transactions:
| transaction_id | customer_id | transaction_date | amount |
|----------------|-------------|------------------|--------|
| 10 | 201 | 2024-01-30 | 800 |
| 11 | 201 | 2024-01-31 | 900 |
| 12 | 201 | 2024-02-01 | 950 |
| 13 | 201 | 2024-02-02 | 1000 |
| 14 | 202 | 2024-01-10 | 10000 |
| 15 | 202 | 2024-01-12 | 5 |
| 16 | 202 | 2024-01-13 | 7 |
| 17 | 203 | 2023-12-31 | 40 |
| 18 | 203 | 2024-01-01 | 60 |
| 19 | 203 | 2024-01-02 | 80 |
| 20 | 203 | 2024-01-03 | 20 |[
{"customer_id":201},
{"customer_id":203}
]Customers 201 and 203 both achieve streak length 4. Amount sizes do not influence the streak metric.
Transactions:
| transaction_id | customer_id | transaction_date | amount |
|----------------|-------------|------------------|--------|
| 30 | 300 | 2025-06-05 | 10 |
| 31 | 301 | 2025-06-20 | 20 |
| 32 | 302 | 2025-07-01 | 30 |[
{"customer_id":300},
{"customer_id":301},
{"customer_id":302}
]Every customer has longest streak length 1, so all customers tie for the global maximum.
Constraints