Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb3aee9

Browse files
author
luzhipeng
committed
更新readme
1 parentfa05b23 commitdb3aee9

11 files changed

+257
-49
lines changed

‎README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,26 @@ leetcode 题解,记录自己的 leecode 解题之路。
1616

1717
>只有熟练掌握基础的数据结构与算法,才能对复杂问题迎刃有余
1818
19-
##食用说明
19+
##食用指南
2020

2121
- 经典题目的解析的目录部分,前面有🆕的代表是最新更新的
2222
- 将来会在这里更新anki卡片
23+
- 这里有一份leetcode官方账号在知乎上给出的一个《互联网公司最常见的面试算法题有哪些?》的答案,我这里尽量去覆盖回答中的题目和知识点
24+
原文地址:https://www.zhihu.com/question/24964987/answer/586425979
25+
26+
- 这里有一张互联网公司面试中经常考察的问题类型总结的思维导图,我们可以结合图片中的信息分析一下。
27+
28+
![leetcode-zhihu](./assets//leetcode-zhihu.jpg)
29+
30+
(图片来自leetcode)
31+
32+
其中算法,主要是以下几种:
33+
34+
- 基础技巧:分治、二分、贪心
35+
- 排序算法:快速排序、归并排序、计数排序
36+
- 搜索算法:回溯、递归、深度优先遍历,广度优先遍历,二叉搜索树等
37+
- 图论:最短路径、最小生成树
38+
- 动态规划:背包问题、最长子序列
2339

2440

2541
##精彩预告
@@ -111,4 +127,18 @@ TODO
111127

112128
[494.target-sum]
113129

130+
[88.merge-sorted-array]
131+
132+
[139.word-break]
133+
134+
[169.majority-element]
135+
136+
[240.search-a-2-d-matrix-ii]
137+
138+
[416.partition-equal-subset-sum]
139+
140+
[609.find-duplicate-file-in-system]
141+
142+
[887.super-egg-drop]
143+
114144
anki 卡片

‎assets/leetcode-zhihu.jpg

34 KB
Loading
File renamed without changes.

‎todo/169.majority-element.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
*@lc app=leetcode id=169 lang=javascript
3+
*
4+
* [169] Majority Element
5+
*
6+
* https://leetcode.com/problems/majority-element/description/
7+
*
8+
* algorithms
9+
* Easy (51.62%)
10+
* Total Accepted: 365.6K
11+
* Total Submissions: 702.5K
12+
* Testcase Example: '[3,2,3]'
13+
*
14+
* Given an array of size n, find the majority element. The majority element is
15+
* the element that appears more than ⌊ n/2 ⌋ times.
16+
*
17+
* You may assume that the array is non-empty and the majority element always
18+
* exist in the array.
19+
*
20+
* Example 1:
21+
*
22+
*
23+
* Input: [3,2,3]
24+
* Output: 3
25+
*
26+
* Example 2:
27+
*
28+
*
29+
* Input: [2,2,1,1,1,2,2]
30+
* Output: 2
31+
*
32+
*
33+
*/
34+
/**
35+
*@param {number[]} nums
36+
*@return {number}
37+
*/
38+
varmajorityElement=function(nums){
39+
40+
};
41+
File renamed without changes.

‎todo/240.search-a-2-d-matrix-ii.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
*@lc app=leetcode id=240 lang=javascript
3+
*
4+
* [240] Search a 2D Matrix II
5+
*
6+
* https://leetcode.com/problems/search-a-2d-matrix-ii/description/
7+
*
8+
* algorithms
9+
* Medium (40.30%)
10+
* Total Accepted: 170K
11+
* Total Submissions: 419.1K
12+
* Testcase Example: '[[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]]\n5'
13+
*
14+
* Write an efficient algorithm that searches for a value in an m x n matrix.
15+
* This matrix has the following properties:
16+
*
17+
*
18+
* Integers in each row are sorted in ascending from left to right.
19+
* Integers in each column are sorted in ascending from top to bottom.
20+
*
21+
*
22+
* Example:
23+
*
24+
* Consider the following matrix:
25+
*
26+
*
27+
* [
28+
* ⁠ [1, 4, 7, 11, 15],
29+
* ⁠ [2, 5, 8, 12, 19],
30+
* ⁠ [3, 6, 9, 16, 22],
31+
* ⁠ [10, 13, 14, 17, 24],
32+
* ⁠ [18, 21, 23, 26, 30]
33+
* ]
34+
*
35+
*
36+
* Given target = 5, return true.
37+
*
38+
* Given target = 20, return false.
39+
*
40+
*/
41+
/**
42+
*@param {number[][]} matrix
43+
*@param {number} target
44+
*@return {boolean}
45+
*/
46+
varsearchMatrix=function(matrix,target){
47+
48+
};
49+

‎todo/301.remove-invalid-parentheses.js

Lines changed: 0 additions & 48 deletions
This file was deleted.
File renamed without changes.

‎todo/88.merge-sorted-array.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
*@lc app=leetcode id=88 lang=javascript
3+
*
4+
* [88] Merge Sorted Array
5+
*
6+
* https://leetcode.com/problems/merge-sorted-array/description/
7+
*
8+
* algorithms
9+
* Easy (34.95%)
10+
* Total Accepted: 347.5K
11+
* Total Submissions: 984.7K
12+
* Testcase Example: '[1,2,3,0,0,0]\n3\n[2,5,6]\n3'
13+
*
14+
* Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as
15+
* one sorted array.
16+
*
17+
* Note:
18+
*
19+
*
20+
* The number of elements initialized in nums1 and nums2 are m and n
21+
* respectively.
22+
* You may assume that nums1 has enough space (size that is greater or equal to
23+
* m + n) to hold additional elements from nums2.
24+
*
25+
*
26+
* Example:
27+
*
28+
*
29+
* Input:
30+
* nums1 = [1,2,3,0,0,0], m = 3
31+
* nums2 = [2,5,6], n = 3
32+
*
33+
* Output: [1,2,2,3,5,6]
34+
*
35+
*
36+
*/
37+
/**
38+
*@param {number[]} nums1
39+
*@param {number} m
40+
*@param {number[]} nums2
41+
*@param {number} n
42+
*@return {void} Do not return anything, modify nums1 in-place instead.
43+
*/
44+
varmerge=function(nums1,m,nums2,n){
45+
46+
};
47+

‎todo/887.super-egg-drop.js

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
*@lc app=leetcode id=887 lang=javascript
3+
*
4+
* [887] Super Egg Drop
5+
*
6+
* https://leetcode.com/problems/super-egg-drop/description/
7+
*
8+
* algorithms
9+
* Hard (24.64%)
10+
* Total Accepted: 6.2K
11+
* Total Submissions: 24.9K
12+
* Testcase Example: '1\n2'
13+
*
14+
* You are given K eggs, and you have access to a building with N floors from 1
15+
* to N. 
16+
*
17+
* Each egg is identical in function, and if an egg breaks, you cannot drop it
18+
* again.
19+
*
20+
* You know that there exists a floor F with 0 <= F <= N such that any egg
21+
* dropped at a floor higher than F will break, and any egg dropped at or below
22+
* floor F will not break.
23+
*
24+
* Each move, you may take an egg (if you have an unbroken one) and drop it
25+
* from any floor X (with 1 <= X <= N). 
26+
*
27+
* Your goal is to know with certainty what the value of F is.
28+
*
29+
* What is the minimum number of moves that you need to know with certainty
30+
* what F is, regardless of the initial value of F?
31+
*
32+
*
33+
*
34+
*
35+
*
36+
*
37+
*
38+
* Example 1:
39+
*
40+
*
41+
* Input: K = 1, N = 2
42+
* Output: 2
43+
* Explanation:
44+
* Drop the egg from floor 1. If it breaks, we know with certainty that F = 0.
45+
* Otherwise, drop the egg from floor 2. If it breaks, we know with certainty
46+
* that F = 1.
47+
* If it didn't break, then we know with certainty F = 2.
48+
* Hence, we needed 2 moves in the worst case to know what F is with
49+
* certainty.
50+
*
51+
*
52+
*
53+
* Example 2:
54+
*
55+
*
56+
* Input: K = 2, N = 6
57+
* Output: 3
58+
*
59+
*
60+
*
61+
* Example 3:
62+
*
63+
*
64+
* Input: K = 3, N = 14
65+
* Output: 4
66+
*
67+
*
68+
*
69+
*
70+
* Note:
71+
*
72+
*
73+
* 1 <= K <= 100
74+
* 1 <= N <= 10000
75+
*
76+
*
77+
*
78+
*
79+
*
80+
*/
81+
/**
82+
*@param {number} K
83+
*@param {number} N
84+
*@return {number}
85+
*/
86+
varsuperEggDrop=function(K,N){
87+
88+
};
89+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp