Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6b8103

Browse files
Create 2220-minimum-bit-flips-to-convert-number.java
1 parent bdaf365 commit a6b8103

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public int minBitFlips(int start, int goal) {
3+
int xorResult = start ^ goal;
4+
return Integer.bitCount(xorResult);
5+
}
6+
}

0 commit comments

Comments
 (0)