【leetcode_easy_sort】1356. Sort Integers by The Number of 1 Bits

problem

1356. Sort Integers by The Number of 1 Bits

solution#1:

code:

 

注意,先按照数字1的数目排序,若相等,则按照整数的大小排序;

参考

1. leetcode_easy_sort_1356. Sort Integers by The Number of 1 Bits;

2. 整数的二进制数据中数字1的个数;

3. __builtin_popcount;

 

posted on 2020-12-02 06:43  鹅要长大  阅读(55)  评论(0编辑  收藏  举报

导航