1009. Complement of Base 10 Integer
Description
**Input:** n = 5
**Output:** 2
**Explanation:** 5 is "101" in binary, with complement "010" in binary, which is 2 in base-10.**Input:** n = 7
**Output:** 0
**Explanation:** 7 is "111" in binary, with complement "000" in binary, which is 0 in base-10.**Input:** n = 10
**Output:** 5
**Explanation:** 10 is "1010" in binary, with complement "0101" in binary, which is 5 in base-10.ac
Previous1008. Construct Binary Search Tree from Preorder TraversalNext1010. Pairs of Songs With Total Durations Divisible by 60
Last updated