sort using lambda based on two criterion

PHOTO EMBED

Thu May 20 2021 13:44:28 GMT+0000 (Coordinated Universal Time)

Saved by @isnottom #python

new_list = sorted(a_list, key=lambda x: (len(x), x))
content_copyCOPY

leetcode

https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits/