LeetCode LintCode 干货全集

LeetCode LintCode 干货全集

事情是这样的. 下面这个就是我在GitHub上面自动生成的LintCode表格. 当时先做的是LintCode, 大约有150来道。

现在转手来做LeetCode,作为复习和巩固,每一篇都会详细把要点摘录一下。而过去做过的这些LintCode, 就不一片片更新拉,一口气放在这篇文章里面。

更新到300多时,已经进入另一个阶段啦。我之前还有做过另外一个专题,叫做ReviewPage, 复习页面,大体上是把做过的题目用中文总结了一遍,方便未来在复习时候可以浏览。在简书这里也贴上一贴吧:ReviewPage复习总结页。

所有内容都来自我的GitHub:

https://github.com/awangdev/LintCode

Java Algorithm Problems

程序员的一天

从开始这个Github已经有将近两年时间, 很高兴这个repo可以帮到有需要的人. 我一直认为, 知识本身是无价的, 因此每逢闲暇, 我就会来维护这个repo, 给刷题的朋友们一些我的想法和见解. 下面来简单介绍一下这个repo:

README.md: 所有所做过的题目

ReviewPage.md: 所有题目的总结和归纳(不断完善中)

KnowledgeHash2.md: 对所做过的知识点的一些笔记

SystemDesign.md: 对系统设计的一些笔记

Future Milestone: 我准备将一些有意思的题目,做成视频的形式给大家参考

在这里! 安利一下自己的副业

介绍一下自己! 大家在YouTube或者B站都可以搜到我: "张土汪"

Youtube: 张土汪

Bilibili: 张土汪

最近一份关于工作的影片: 程序猿二月工作爆肝回忆录!

最近我开始在做自己的Youtube Channel, 虽然还没有定下任何方向, 但是目前我会做几部分的内容:

工作经验的分享/目前学习经历: 当然会跟Software Engineer比较相关

在美国的生活/学生时代的经历, vlog等

个人的兴趣爱好: 唱歌!!!

希望在这里参考刷题经验时, 可以去关注我的Channel! 有任何对在美国工作的疑问, 疑惑, 都可以给我留言/私信/邮件.

程序猿二月工作爆肝回忆录!

希望大家学习顺利, 对未来充满希望!

有问题可以给我写邮件(wangdeve@gmail.com), 或者在GitHub上发issue给我.

下面进入干货索引.

Sequence

Problem

0

Count of Smaller Number before itself.java

1

Evaluate Division.java

2

Fraction to Recurring Decimal.java

3

Gray Code.java

4

Hamming Distance.java

5

Happy Number.java

6

HashWithArray.java

7

Heaters.java

8

IndexMatch.java

9

Insert Node in a Binary Search Tree .java

10

Jewels and Stones.java

11

Kth Smallest Sum In Two Sorted Arrays.java

12

LFU Cache.java

13

Longest Univalue Path.java

14

Majority Number II.java

15

Majority Number III.java

16

Matrix Zigzag Traversal.java

17

Maximum Subarray III.java

18

Minimum Absolute Difference in BST.java

19

Minimum Height Trees.java

20

Missing Ranges.java

21

Next Permutation.java

22

O(1) Check Power of 2.java

23

Palindrome Permutation II.java

24

Partition Array by Odd and Even.java

25

Pascal's Triangle II.java

26

Permutation Index.java

27

Permutation Sequence.java

28

Prefix and Suffix Search.java

29

Product of Array Exclude Itself.java

30

Recover Rotated Sorted Array.java

31

Remove Duplicates from Unsorted List.java

32

Remove Node in Binary Search Tree.java

33

Reshape the Matrix.java

34

Reverse String.java

35

Rotate Image.java

36

Search in Rotated Sorted Array II.java

37

Search Insert Position.java

38

Shortest Word Distance.java

39

Single Number II.java

40

Single Number III.java

41

Single Number.java

42

Space Replacement.java

43

Stone Game.java

44

String Permutation.java

45

Subarray Sum II.java

46

The Smallest Difference.java

47

Total Occurrence of Target.java

48

Trailing Zeros.java

49

Two Lists Sum.java

50

Two Strings Are Anagrams.java

51

Valid Sudoku.java

52

Word Pattern.java

53

Zigzag Iterator.java

54

Find Anagram Mappings.java

55

Judge Route Circle.java

56

Island Perimeter.java

57

Power of Three.java

58

Plus One.java

59

Power of Two.java

60

Reverse Vowels of a String.java

61

Guess Number Higher or Lower.java

62

Encode and Decode TinyURL.java

63

Wiggle Sort.java

64

Queue Reconstruction by Height.java

65

Two Sum II - Input array is sorted.java

66

2 Sum II.java

67

Coin Change.java

68

Maximum Product Subarray.java

69

3 Sum Closest.java

70

Triangle Count.java

71

3Sum.java

72

k Sum.java

73

Unique Binary Search Tree.java

74

Trim a Binary Search Tree.java

75

Unique Paths II.java

76

Bomb Enemy.java

77

3Sum Smaller.java

78

Array Partition I.java

79

1-bit and 2-bit Characters.java

80

Non-decreasing Array.java

81

Max Consecutive Ones.java

82

Find All Numbers Disappeared in an Array.java

83

Maximum Average Subarray I.java

84

Largest Number At Least Twice of Others.java

85

Toeplitz Matrix.java

86

Sum of Two Integers.java

87

Swap Bits.java

88

Update Bits.java

89

Maximum XOR of Two Numbers in an Array.java

90

Perfect Squares.java

91

Backpack VI.java

92

Copy Books.java

93

Valid Perfect Square.java

94

Intersection of Two Arrays II.java

95

Scramble String.java

96

Binary Search Tree Iterator.java

97

Flatten Nested List Iterator.java

98

Best Time to Buy and Sell Stock with Cooldown.java

99

Find Peak Element.java

100

Longest Common Subsequence.java

101

Interleaving String.java

102

Letter Combinations of a Phone Number.java

103

Edit Distance.java

104

Distinct Subsequences.java

105

Majority Element.java

106

Ones and Zeroes.java

107

Pow(x, n).java

108

Word Break II.java

109

Nested List Weight Sum.java

110

Same Tree.java

111

Convert Sorted Array to Binary Search Tree.java

112

Construct Binary Tree from Preorder and Inorder Traversal.java

113

Add Digits.java

114

Add Two Numbers.java

115

Add Two Numbers II.java

116

Balanced Binary Tree.java

117

Valid Anagram.java

118

Populating Next Right Pointers in Each Node.java

119

Validate Binary Search Tree.java

120

Convert Sorted List to Binary Search Tree.java

121

Flatten Binary Tree to Linked List.java

122

Binary Tree Paths.java

123

Minimum Size Subarray Sum.java

124

Longest Substring Without Repeating Characters.java

125

Minimum Window Substring.java

126

Linked List Cycle.java

127

Remove Nth Node From End of List.java

128

Longest Substring with At Most K Distinct Characters.java

129

Linked List Cycle II.java

130

Kth Smallest Element in a Sorted Matrix.java

131

Find Minimum in Rotated Sorted Array.java

132

Find Minimum in Rotated Sorted Array II.java

133

Connecting Graph.java

134

Connecting Graph II.java

135

Connecting Graph III.java

136

Number of Islands.java

137

Number of Islands II.java

138

Surrounded Regions.java

139

Implement Trie (Prefix Tree).java

140

Add and Search Word - Data structure design.java

141

Word Search II.java

142

Word Search.java

143

Word Squares.java

144

Trapping Rain Water.java

145

Min Stack.java

146

Implement Queue using Stacks.java

147

Decode String.java

148

Largest Rectangle in Histogram.java

149

Maximum Binary Tree.java

150

Reverse Integer.java

151

Swap Nodes in Pairs.java

152

Find Peak Element II.java

153

Sqrt(x).java

154

First Bad Version.java

155

Wood Cut.java

156

Find the Duplicate Number.java

157

Palindrome Pairs.java

158

Game of Life.java

159

Maximum Average Subarray II.java

160

Meeting Rooms.java

161

Number of Airplane in the sky.java

162

Meeting Rooms II.java

163

The Skyline Problem.java

164

Unique Path.java

165

Maximal Rectangle.java

166

Maximal Square.java

167

Longest Increasing Path in a Matrix.java

168

Coins in a Line.java

169

Coins in a Line II.java

170

Binary Tree Inorder Traversal.java

171

Binary Tree Postorder Traversal.java

172

Change to Anagram.java

173

Classical Binary Search.java

174

Climbing Stairs.java

175

Coins in a Line III.java

176

Closest Binary Search Tree Value.java

177

Compare Version Numbers.java

178

Count Complete Tree Nodes.java

179

Course Schedule.java

180

Course Schedule II.java

181

Binary Tree Preorder Traversal.java

182

Closest Number in Sorted Array.java

183

Complete Binary Tree.java

184

Compare Strings.java

185

Contains Duplicate.java

186

Contains Duplicate II.java

187

Contains Duplicate III.java

188

Burst Balloons.java

189

Nim Game.java

190

Convert Integer A to Integer B.java

191

Cosine Similarity.java

192

Count 1 in Binary.java

193

Count and Say.java

194

K Edit Distance.java

195

Jump Game.java

196

Coin Change 2.java

197

Paint House.java

198

Decode Ways.java

199

Longest Continuous Increasing Subsequence.java

200

Minimum Path Sum.java

201

Counting Bits.java

202

Continuous Subarray Sum.java

203

House Robber.java

204

House Robber II.java

205

House Robber III.java

206

Paint House II.java

207

Best Time to Buy and Sell Stock III.java

208

Best Time to Buy and Sell Stock IV.java

209

Russian Doll Envelopes.java

210

Permutation in String.java

211

Permutations II.java

212

Shuffle an Array.java

213

Find All Anagrams in a String.java

214

Group Anagrams.java

215

Backpack.java

216

Backpack II.java

217

Backpack V.java

218

Count Primes.java

219

Delete Node in a Linked List.java

220

Excel Sheet Column Number.java

221

Excel Sheet Column Title.java

222

Flip Game.java

223

Expression Tree Build.java

224

Expression Evaluation.java

225

Convert Expression to Polish Notation.java

226

Convert Expression to Reverse Polish Notation.java

227

Evaluate Reverse Polish Notation.java

228

Decode Ways II.java

229

Palindrome Partitioning II.java

230

Backpack III.java

231

First Missing Positive.java

232

Implement strStr().java

233

Insertion Sort List.java

234

Interleaving Positive and Negative Numbers.java

235

Largest Number.java

236

Last Position of Target.java

237

Length of Last Word.java

238

Longest Common Substring.java

239

Longest Increasing Continuous subsequence.java

240

Longest Increasing Continuous subsequence II.java

241

N-Queens.java

242

N-Queens II.java

243

Maximum Subarray.java

244

Maximum Subarray II.java

245

Median.java

246

Middle of Linked List.java

247

Singleton.java

248

Remove Linked List Elements.java

249

Fibonacci.java

250

Palindrome Linked List.java

251

Reverse Linked List.java

252

Reverse Linked List II .java

253

Intersection of Two Linked Lists.java

254

Palindrome Permutation.java

255

Valid Palindrome.java

256

Implement Stack using Queues.java

257

Implement Stack.java

258

Invert Binary Tree.java

259

Maximum Depth of Binary Tree.java

260

Minimum Depth of Binary Tree.java

261

Symmetric Tree.java

262

Tweaked Identical Binary Tree.java

263

Merge Two Binary Trees.java

264

Subtree.java

265

Lowest Common Ancestor of a Binary Tree.java

266

Lowest Common Ancestor II.java

267

Lowest Common Ancestor of a Binary Search Tree.java

268

Hash Function.java

269

Merge Two Sorted Lists.java

270

Missing Number.java

271

LRU Cache.java

272

Remove Duplicates from Sorted Array.java

273

Remove Duplicates from Sorted Array II.java

274

Remove Duplicates from Sorted List.java

275

Remove Duplicates from Sorted List II.java

276

QuickSort.java

277

MergeSort.java

278

Longest Word in Dictionary.java

279

Binary Tree Level Order Traversal.java

280

Binary Tree Level Order Traversal II.java

281

Binary Tree Longest Consecutive Sequence II.java

282

Binary Tree Maximum Path Sum.java

283

Path Sum.java

284

Path Sum II.java

285

Path Sum III.java

286

Rotate String.java

287

Combinations.java

288

Combination Sum IV.java

289

Binary Tree Right Side View.java

290

Binary Tree Maximum Path Sum II.java

291

Rotate List.java

292

Basic Calculator.java

293

Longest Consecutive Sequence.java

294

Binary Tree Longest Consecutive Sequence.java

295

Number of Connected Components in an Undirected Graph.java

296

Next Closest Time.java

297

Serialize and Deserialize Binary Tree.java

298

Partition Array.java

299

Word Ladder.java

300

Unique Word Abbreviation.java

301

Unique Binary Search Tree II.java

302

Ugly Number.java

303

Top K Frequent Words.java

304

Segment Tree Build.java

305

Segment Tree Build II.java

306

Segment Tree Query.java

307

Segment Tree Modify.java

308

Segment Tree Query II.java

309

Count of Smaller Numbers After Self.java

310

ColorGrid.java

311

Container With Most Water.java

312

Copy List with Random Pointer.java

313

Encode and Decode Strings.java

314

Fast Power.java

315

Find the Connected Component in the Undirected Graph.java

316

HashWithCustomizedClass(LinkedList).java

317

Interval Minimum Number.java

318

Interval Sum.java

319

Kth Smallest Element in a BST.java

320

Longest Common Prefix.java

321

Majority Element II.java

322

Partition List.java

323

Peeking Iterator.java

324

Rehashing.java

325

Reorder List.java

326

Restore IP Addresses.java

327

Reverse Words in a String.java

328

Reverse Words in a String II.java

329

Reverse Words in a String III.java

330

Search a 2D Matrix.java

331

Search a 2D Matrix II.java

332

Search for a Range.java

333

Search Range in Binary Search Tree .java

334

Merge Sorted Array II.java

335

Nth to Last Node in List.java

336

Sort List.java

337

Summary Ranges.java

338

Topological Sorting.java

339

Remove Duplicate Letters.java

340

Spiral Matrix.java

341

Expression Add Operators.java

342

Insert Interval.java

343

Shortest Palindrome.java

344

Two Sum.java

345

K Empty Slots.java

346

Count of Range Sum.java

347

Max Sum of Rectangle No Larger Than K.java

348

Perfect Rectangle.java

349

Construct Binary Tree from Inorder and Postorder Traversal.java

350

Generate Parentheses.java

351

Strobogrammatic Number II.java

352

Flip Game II.java

353

Max Area of Island.java

354

Max Points on a Line.java

355

Number of Digit One.java

356

Binary Representation.java

357

Palindrome Partitioning.java

358

Recover Binary Search Tree.java

359

Subarray Sum.java

360

Submatrix Sum.java

361

Longest Palindromic Substring.java

362

Longest Palindromic Subsequence.java

363

Jump Game II.java

364

Gas Station.java

365

Triangles.java

366

Range Sum Query - Immutable.java

367

Longest Valid Parentheses.java

368

Remove Invalid Parentheses.java

369

Merge Intervals.java

370

H-Index.java

371

H-Index II.java

372

Sort Colors.java

373

Sort Colors II.java

374

Sort Letters by Case.java

375

Subarray Sum Closest.java

376

Task Scheduler.java

377

Rearrange String k Distance Apart.java

378

Exam Room.java

379

Anagrams.java

380

Path Sum IV.java

381

Longest Words.java

382

Unique Characters.java

383

Number Of Corner Rectangles.java

384

Palindromic Substrings.java

385

Multiply Strings.java

386

Subsets.java

387

Subsets II.java

388

Combination Sum.java

389

Combination Sum II.java

390

Combination Sum III.java

391

Product of Array Except Self.java

392

Total Hamming Distance.java

393

Smallest Subtree with all the Deepest Nodes.java

394

Binary Gap.java

395

Subarray Sum Equals K.java

396

Maximize Distance to Closest Person.java

397

Simplify Path.java

398

Convert Binary Search Tree to Sorted Doubly Linked List (extra space).java

399

Paint Fence.java

400

Binary Tree Zigzag Level Order Traversal.java

401

Word Break.java

402

Best Time to Buy and Sell Stock.java

403

Best Time to Buy and Sell Stock II.java

404

Longest Increasing Subsequence.java

405

Best Time to Buy and Sell Stock with Transaction Fee.java

406

Random Pick Index.java

407

Find the Celebrity.java

408

Sparse Matrix Multiplication.java

409

Brick Wall.java

410

Exclusive Time of Functions.java

411

Friends Of Appropriate Ages.java

412

Target Sum.java

413

Maximum Size Subarray Sum Equals k.java

414

Contiguous Array.java

415

Line Reflection.java

416

Insert Delete GetRandom O(1).java

417

Number of Longest Increasing Subsequence.java

418

Minimum Swaps To Make Sequences Increasing.java

419

Binary Tree Vertical Order Traversal.java

420

Populating Next Right Pointers in Each Node II.java

421

Search in Rotated Sorted Array.java

422

Minimum Subarray.java

423

Valid Number.java

424

Find the Weak Connected Component in the Directed Graph.java

425

Accounts Merge.java

426

Bricks Falling When Hit.java

427

Interval Sum II.java

428

Count of Smaller Number.java

429

HashHeap.java

430

My Calendar I.java

431

Reverse Pairs.java

432

Trapping Rain Water II.java

433

Kth Largest Element in an Array.java

434

Merge k Sorted Lists.java

435

Merge k Sorted Arrays.java

436

Heapify.java

437

Top K Frequent Elements.java

438

Ugly Number II.java

439

Find Median from Data Stream.java

440

Sliding Window Median.java

441

Inorder Successor in BST.java

442

Subtree of Another Tree.java

443

Two Sum IV - Input is a BST.java

444

Read N Characters Given Read4.java

445

Design Search Autocomplete System.java

446

Walls and Gates.java

447

Merge Sorted Array.java

448

Integer to English Words.java

449

Alien Dictionary.java

450

Valid Palindrome II.java

451

Convert Binary Search Tree to Sorted Doubly Linked List.java

452

Word Ladder II.java

453

Moving Average from Data Stream.java

454

Move Zeroes.java

455

Flood Fill.java

456

Diameter of Binary Tree.java

457

Backspace String Compare.java

458

Text Justification.java

459

Read N Characters Given Read4 II - Call multiple times.java

460

Frog Jump.java

461

Longest Substring with At Most Two Distinct Characters.java

462

Shortest Distance from All Buildings.java

463

String to Integer (atoi).java

464

Roman to Integer.java

465

Intersection of Two Arrays.java

466

Strobogrammatic Number.java

467

Valid Parentheses.java

468

First Unique Character in a String.java

469

Add Binary.java

470

Clone Graph.java

471

Sliding Window Maximum.java

472

Median of Two Sorted Arrays.java

473

Permutations.java

474

One Edit Distance.java

475

4Sum.java

476

Bus Routes.java

477

Sliding Puzzle.java

478

Isomorphic Strings.java

479

Cracking the Safe.java

480

Redundant Connection.java

481

Graph Valid Tree.java

482

Redundant Connection II.java

483

The Maze.java

484

The Maze II.java

485

The Maze III.java

486

Predict the Winner.java

487

Next Greater Element I.java

488

Group Shifted Strings.java

489

Delete Digits.java

490

Flatten 2D Vector.java

491

The Spiral Matrix II.java

492

Regular Expression Matching.java

493

Wildcard Matching.java

494

Robot Room Cleaner.java

495

Maximum Vacation Days.java

相关推荐

被嫌弃的顺风车的一生
百特365下载

被嫌弃的顺风车的一生

01-17 👁️ 3045
不妨来试试手机上的像素佳作?50款像素手游推荐!
国际钢琴大师朗朗,从苦难与磨砺中成长,为什么这么多人不喜欢他
火影忍者金鸣什么时候出来
bet体育365官网用什么浏览器

火影忍者金鸣什么时候出来

07-06 👁️ 2207