706. Design HashMap设计哈希映射【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

By |2021-07-26T03:23:38+00:00July 20th, 2021|LeetCode, Leetcode题目讲解|1 Comment

26.Remove Duplicates from 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

By |2021-05-25T05:55:46+00:00May 23rd, 2021|LeetCode, Leetcode题目讲解|2 Comments

Top Sliding Bar

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

Recent Tweets


Sign-up to get the latest news and update information. Don't worry, we won't send spam!

[contact-form-7 id="3145" title="Sliding Bar Form"]
Go to Top