Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ee1d15

Browse files
refactor 1009
1 parent195dd99 commit5ee1d15

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

‎src/main/java/com/fishercoder/solutions/_1009.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,6 @@
33
importjava.util.ArrayList;
44
importjava.util.List;
55

6-
/**
7-
* 1009. Complement of Base 10 Integer
8-
*
9-
* Every non-negative integer N has a binary representation.
10-
* For example, 5 can be represented as "101" in binary,
11-
* 11 as "1011" in binary, and so on.
12-
*
13-
* Note that except for N = 0, there are no leading zeroes in any binary representation.
14-
*
15-
* The complement of a binary representation is the number in binary you get when
16-
* changing every 1 to a 0 and 0 to a 1. For example, the complement of "101" in binary is "010" in binary.
17-
*
18-
* For a given number N in base-10, return the complement of it's binary representation as a base-10 integer.
19-
*
20-
* Example 1:
21-
* Input: 5
22-
* Output: 2
23-
* Explanation: 5 is "101" in binary, with complement "010" in binary, which is 2 in base-10.
24-
*
25-
* Example 2:
26-
* Input: 7
27-
* Output: 0
28-
* Explanation: 7 is "111" in binary, with complement "000" in binary, which is 0 in base-10.
29-
*
30-
* Example 3:
31-
* Input: 10
32-
* Output: 5
33-
* Explanation: 10 is "1010" in binary, with complement "0101" in binary, which is 5 in base-10.
34-
*
35-
* Note:
36-
* 0 <= N < 10^9
37-
* */
386
publicclass_1009 {
397
publicstaticclassSolution1 {
408
publicintbitwiseComplement(intN) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp