我的输入哈希:
h = [
{user_id: 1, bookings_nd: 3},
{user_id: 2, bookings_nd: 10},
{user_id: 3, bookings_nd: 2}
]
Run Code Online (Sandbox Code Playgroud)
我需要:
h = [
{user_id: 2, bookings_nd: 10},
{user_id: 1, bookings_nd: 3},
{user_id: 3, bookings_nd: 2}
]
Run Code Online (Sandbox Code Playgroud)
怎么做?