摘要:
方法一: class Solution { public int subarraysDivByK(int[] A, int K) { Map<Integer, Integer> record = new HashMap<>(); record.put(0, 1); int sum = 0, ans 阅读全文
摘要:
方法一: public class Solution { public int findDuplicate(int[] nums) { int len = nums.length; int left = 1; int right = len - 1; while (left < right) { / 阅读全文
摘要:
牛 class Node { public int key, val; public Node next, prev; public Node(int k, int v) { this.key = k; this.val = v; } } class DoubleList { private Nod 阅读全文
摘要:
方法一: class Solution { public double findMedianSortedArrays(int[] A, int[] B) { int m = A.length; int n = B.length; int len = m + n; int left = -1, rig 阅读全文
摘要:
官方给出答案 class Solution { public int findTheLongestSubstring(String s) { int n = s.length(); int[] pos = new int[1 << 5]; Arrays.fill(pos, -1); int ans 阅读全文