Given an integer n, return the length of the longest consecutive run of ones in its binary representation. Input: a single integer. Output: the length of the longest run of 1s.
Example 1:
Example 2:
Constraints:
0 <= n <= 2^31 - 1
Tags: