101
0/304
Loading content...
A reporting pipeline stores two numeric signals in the same table, but downstream ranking requires each signal to be ordered independently before recombining rows.
Table: Data
Task: Produce an output table with the same number of rows as Data such that:
Output requirements:
Supported submission environments:
Data:
| first_col | second_col |
|-----------|------------|
| 4 | 2 |
| 2 | 3 |
| 3 | 1 |
| 1 | 4 |[
{"first_col":1,"second_col":4},
{"first_col":2,"second_col":3},
{"first_col":3,"second_col":2},
{"first_col":4,"second_col":1}
]Sort first_col ascending -> [1,2,3,4], sort second_col descending -> [4,3,2,1], then pair by index.
Data:
| first_col | second_col |
|-----------|------------|
| 5 | 10 |
| 5 | 7 |
| 1 | 7 |
| 3 | 9 |
| 3 | 8 |
| 1 | 10 |[
{"first_col":1,"second_col":10},
{"first_col":1,"second_col":10},
{"first_col":3,"second_col":9},
{"first_col":3,"second_col":8},
{"first_col":5,"second_col":7},
{"first_col":5,"second_col":7}
]Duplicate values are valid. Column-wise sorting is performed independently before row pairing.
Data:
[][]No input rows means no output rows.
Constraints