739. Daily Temperatures 每日温度【LeetCode单题讲解系列】
739. Daily Temperatures 每日温度【LeetCode单题讲解系列】
739. Daily Temperatures 每日温度【LeetCode单题讲解系列】
206. Reverse Linked List反转链表【LeetCode单题讲解系列】
19.Remove Nth Node From End of List删除链表的倒数第N个节点【LeetCode单题讲解系列】
无法播放?请 点击这里 跳转到Youtube 切换视频源: 题目: https://leetcode.com/problems/design-hashmap/ class MyHashMap { private Node[] buckets; private int size; private static final double LOAD_FACTOR = 0.75; /** Initialize your data structure here. */ public MyHashMap() { size = 0; buckets = new Node[16]; } /** value will always be non-negative. */ public void put(int key, int value) { int
876.Middle of the Linked List 链表的中间结点【LeetCode单题讲解系列】
leetcode 34.Find First and Last Position of Element in Sorted Array在排序数组中寻找元素的第一和最后一个位置【LeetCode单题讲解系列】
无法播放?请 点击这里 跳转到Youtube 切换视频源: 题目链接: https://leetcode.com/problems/remove-duplicates-from-sorted-array/ GitHub答案链接: https://github.com/turingplanet/leetcode-answers Set解法 class Solution { public int removeDuplicates(int[] nums) { Set<Integer> set = new LinkedHashSet<>(); for (int x : nums) { set.add(x); } int index = 0; for (int x : set) { nums[index++] = x; } return set.size(); } } Two Pointers解法 class Solution { public int
344.Reverse String反转字符串【LeetCode单题讲解系列】
704.Binary Search二分查找【LeetCode单题讲解系列】
703.Kth Largest Element in a Stream数据流中的第K大元素