Loading problem...
A geography data platform stores city membership records by state and needs a deterministic per-state summary string for downstream reporting.
Table: Cities
The pair (state, city) is unique.
Task: For every state, produce one row that contains:
Output requirements:
Supported submission environments:
Cities:
| state | city |
|------------|---------------|
| California | Los Angeles |
| California | San Francisco |
| California | San Diego |
| Texas | Houston |
| Texas | Austin |
| Texas | Dallas |
| New York | New York City |
| New York | Buffalo |
| New York | Rochester |[
{"state":"California","cities":"Los Angeles, San Diego, San Francisco"},
{"state":"New York","cities":"Buffalo, New York City, Rochester"},
{"state":"Texas","cities":"Austin, Dallas, Houston"}
]Each state gets one output row. Cities are sorted alphabetically inside each state before joining with ', '.
Cities:
| state | city |
|---------|------------|
| Nevada | Reno |
| Nevada | Henderson |
| Nevada | Las Vegas |
| Nevada | Carson City|[
{"state":"Nevada","cities":"Carson City, Henderson, Las Vegas, Reno"}
]With a single state, output still requires sorted city concatenation.
Cities:
| state | city |
|-----------|-------------|
| Oregon | Portland |
| Arizona | Mesa |
| Oregon | Salem |
| Arizona | Phoenix |
| Arizona | Tucson |
| Oregon | Eugene |[
{"state":"Arizona","cities":"Mesa, Phoenix, Tucson"},
{"state":"Oregon","cities":"Eugene, Portland, Salem"}
]Rows are sorted by state, and each state's city list is sorted independently.
Constraints