Sort a keyed list by value descending, preserving relative order of equal values (stable). Input: JSON array of {"key": string, "value": number}. Print the keys in render order as a JSON array.
Input: one JSON array. Output: JSON array of keys.
Your program reads from stdin and prints to stdout.
Example 1
Input: [{"key":"a","value":2},{"key":"b","value":5},{"key":"c","value":2}]
Output: ["b","a","c"]
Hints
Sort a keyed list by value descending, preserving relative order of equal values (stable). Input: JSON array of {"key": string, "value": number}. Print the keys in render order as a JSON array.
Input: one JSON array. Output: JSON array of keys.
Your program reads from stdin and prints to stdout.
Example 1
Input: [{"key":"a","value":2},{"key":"b","value":5},{"key":"c","value":2}]
Output: ["b","a","c"]
Hints