1. Array 基础 27 Remove Element 26 Remove Duplicates from Sorted Array 80 Remove Duplicates from Sorted Array II 277 Find the Celebrity 189 Rotate Array 41 First Missing Positive 299 Bulls and Cows 134 Gas Station 118 Pascal's Triangle 很少考 119 Pascal's
目录 这是一个对LeetCode题目归类的索引,分类标准参考了July大神的<编程之法>以及LeetCode的tag项.分类可能还不太合理,逐步完善,请见谅~ 题主本人也在一点一点的刷题,这个目录跟着刷的题每天更新~ Hope you enjoy coding! 数组 Array 寻找和为定值的两个数 1.Two Sum 167.Two Sum II 从数组移除元素 26.Remove Duplicates from Sorted Array 27.Remove Element 283.Mov
[334]Increasing Triplet Subsequence (2019年2月14日,google tag)(greedy) 给了一个数组 nums,判断是否有三个数字组成子序列,使得子序列递增.题目要求time complexity: O(N),space complexity: O(1) Return true if there exists i, j, k such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k
算法面试过程中,题目类型多,数量大.大家都不可避免的会在LeetCode上进行训练.但问题是,题目杂,而且已经超过1300道题. 全部刷完且掌握,不是一件容易的事情.那我们应该怎么办呢?找规律,总结才是制胜法宝. 下面我们就来看看 Grokking the Coding Interview: Patterns for Coding Questions 的分类及每个类型的经典题目: 1. Pattern: Sliding window,滑动窗口类型 经典题目: Maximum Sum Subar
If you understand the comments below, never will you make mistakes with binary search! thanks to A simple CPP solution with lower_bound and C++ O(logn) Binary Search that handles duplicate, thanks to phu1ku 's answer on the second post. http://en.cpp
for the backtracking part, thanks to the video of stanford cs106b lecture 10 by Julie Zelenski for the nice explanation of recursion and backtracking, highly recommended. in hdu 2553 cout N-Queens solutions problem, dfs is used. // please ignore, bel