Plus One
Description
给定一个用数组表示的十进制数,将数字加一。
Example 1:
1 2 3Input: [1,2,3] Output: [1,2,4] Explanation: The array represents the integer 123.Example 2:
1 2 3Input: [4,3,2,1] Output: [4,3,2,2] Explanation: The array represents the integer 4321.
Solution
| |
Add Binary
Discription
将两个二进制字符串相加
Example 1:
1 2Input: a = "11", b = "1" Output: "100"Example 2:
1 2Input: a = "1010", b = "1011" Output: "10101"
Solution
| |