摘要:
链接 https://leetcode-cn.com/problems/fair-candy-swap/ 思路:假设从A中拿出y给B,从B中拿出x给A,则sumA+x-y=sumB-x+y, 即y=(sumA-sumB)/2+x public int[] fairCandySwap(int[] A, 阅读全文
摘要:
链接 https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ 思路一:双指针+HashSet 官方题解 class Solution { public int lengthOfLongestSu 阅读全文
摘要:
链接 https://leetcode-cn.com/problems/number-of-equivalent-domino-pairs/ 代码如下 public class Problem1128 { public int numEquivDominoPairs(int[][] dominoes 阅读全文