Array and Strings Array and String type of questions were asked in interviews frequently. You will most likely encounter one during your interviews. We recommend: Product of Array Except Self, Spiral Matrix, First Missing Positive, Longest Substring with At Most K Distinct Characters, Sliding Window...
welcome to my blog LeetCode Top Interview Questions 268. Missing Number (Java版; Easy) 题目描述 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output: 2 Example 2: Inpu...
LeetCode Top Interview Questions 217. Contains Duplicate (Java版; Easy) 题目描述 Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct....
LeetCode Top Interview Questions https://leetcode.com/problemset/top-interview-questions/
Convert Sorted Array to Binary Search Tree Convert Sorted List to Binary Search Tree Count and Say Decode Ways Depth of Binary Tree Divide Two Integers Edit Distance First Missing Positive Generate Parentheses Gray Code Implement strStr() Insert Interval ...
Foreach element in the array, we findthe maximum level of water it can trap after the rain, which is equal to the minimum of maximum height of bars on both the sides minus its own height. min(left max, right max)−height[i] 对于每个点,我们找其承接的水的高度。
https://leetcode.com/problems/squares-of-a-sorted-array/ 3. Pattern: Fast & Slow pointers,快慢指针类型 这种模式,有一个非常出门的名字,叫龟兔赛跑。咱们肯定都知道龟兔赛跑啦。但还是再解释一下快慢指针:这种算法的两个指针的在数组上(或是链表上,序列上)的移动速度不一样。还别说,这种方法在解决有环...
1296. 划分数组为连续数字的集合 - 给你一个整数数组 nums 和一个正整数 k,请你判断是否可以把这个数组划分成一些由 k 个连续数字组成的集合。如果可以,请返回 true;否则,返回 false。 示例 1: 输入:nums = [1,2,3,3,4,4,5,6], k = 4 输出:true 解释:数组可
TopInterview.md readme.md Repository files navigation README LeetCode 指南语言: Java 说明: 每道题在代码头部都添加了我的解题思路和批注,Eg: /*** * 287. Find the Duplicate Number * 题意:n+1个数属于[1~n],找出重复的那个数 * 难度:Medium * 分类:Array, Two Pointers, Binary Search...
Collection of LeetCode questions to ace the coding interview! - Created using [LeetHub](https://github.com/QasimWani/LeetHub) - jay-tau/leetcode-problems