数字
Data Structures & Algorithms · 4 notes
- Counting Bitshistorical
Given a non-negative integer num. For every number i in the range 0 ≤ i ≤ num, calculate the number of 1s in its binary representation and return them as an array.
- Hamming Distancehistorical
The Hamming distance between two integers is the number of positions at which their corresponding binary bits are different.
- Reverse Integerhistorical
Given a 32-bit signed integer x, return the result of reversing the digits of x.
- Climbing Stairshistorical
A staircase has n steps, and each move climbs one or two steps. Count the distinct ways to reach the top.