摘要:
1 public class Solution { 2 public int hammingDistance(int x, int y) { 3 int ans = 0; 4 while (x > 0 || y > 0) { 5 ans += (x % 2) ^ (y % 2); 6 x /= 2... 阅读全文
摘要:
1 public class Solution { 2 public boolean canConstruct(String ransomNote, String magazine) { 3 int[] ransomNum = new int[256]; 4 int[] magNum = new int[256]; 5 for (... 阅读全文
摘要:
1 public class Solution { 2 public int[] twoSum(int[] numbers, int target) { 3 int left = 0; 4 int right = numbers.length - 1; 5 while (left < right) { 6 ... 阅读全文