摘要:
lc25 k个一组反转单链表 class Solution { public ListNode reverseKGroup(ListNode head, int k) { ListNode dummy = new ListNode(0, head); ListNode pre = dummy; wh 阅读全文
摘要:
lc15 三数之和 class Solution { public List<List<Integer>> threeSum(int[] nums) { List<List<Integer>> ans = new ArrayList<>(); Arrays.sort(nums); for (int 阅读全文
摘要:
lc215 数组中的第k个最大大元素 快排解法 class Solution { public int findKthLargest(int[] nums, int k) { return findKthLargest(nums, k-1, 0, nums.length-1); } public i 阅读全文
摘要:
lc6190找到所有好下标 class Solution { public List<Integer> goodIndices(int[] nums, int k) { int[] left = new int[nums.length], right = new int[nums.length]; 阅读全文
摘要:
lc146 LRU缓存 class LRUCache { class Node { int key; int value; Node prev; Node next; public Node(){ } public Node(int key, int value){ this.key = key; 阅读全文