I have a JSONObject which I get via an API. It is like this:
{
"wash_method": 305,
"fragrance": 1156,
"sweater_type": 260,
"dial_color": 66475,
"charger_type": 2581,
"pen_drives_interface": 563,
"watches_type": 66475,
"processor": 3270,
"frame_material": 1211,
"dial_shape": 66475,
"os": 3308
}
I want to sort this on the basis of values to get a result like this:
{
"dial_shape": 66475,
"dial_color": 66475,
"watches_type": 66475,
"os": 3308,
"processor": 3270,
"charger_type": 2581,
"frame_material": 1211,
"fragrance": 1156,
"pen_drives_interface": 563,
"wash_method": 305,
"sweater_type": 260,
}
As you can see top 3 items have similar value so they can get arranged in any way.
How can I do this? (Is there a way to do it with minimum complexity ?)