我的秋招基本完全结束,拿到的意向书也比较多,这里简单总结一下自己算法的准备过程。
先说背景:非ACMer,虽然科班出身,但是算法基础个人觉得算比较差的。我大概从年初疫情刚开始的时候开始刷leetcode,现在题目数量在500左右,并且大多数题都做了2遍以上(因为确实容易忘😂)。下面列出了一个长长长长的列表,是我刷过的题里我觉得比较好的题,格式为题目编号-题目名。
最近也有一些朋友问我算法题怎么刷,我自己的体会是一开始刷会比较痛苦,很多题都实在想不出来思路。个人觉得最好的方式是一道题自己想10到15分钟,完全没思路就看题解,然后在自己写出来代码,有思路的话就先自己写一下,然后在看题解有没有可以优化的。一开始会比较慢,但是题做的多了会慢慢总结出来套路,到后面基本就是拿到一道题就大概立刻能想到改往什么方向想。
另外最近看到一个git仓库,讲算法的,感觉不错:f**ing-algorithm(害怕链接被吞,左边是仓库名) - https://github.com/labuladong/***ing-algorithm
002 - Add Two Numbers 003 - Longest Substring Without Repeating Characters 005 - Longest Palindromic Substring 011 - Container With Most Water 015 - 3Sum 017 - Letter Combinations of a Phone Number 018 - 4Sum 019 - Remove Nth Node From End of List 022 - Generate Parentheses 024 - Swap Nodes in Pairs 031 - Next Permutation 033 - Search in Rotated Sorted Array 034 - Find First and Last Position of Element in Sorted Array 035 - Search Insert Position 048 - Rotate Image 049 - Group Anagrams 053 - Maximum Subarray 055 - Jump Game 059 - Spiral Matrix II 060 - Permutation Sequence 063 - Unique Paths II 064 - Minimum Path Sum 073 - Set Matrix Zeroes 075 - Sort Colors 079 - Word Search 082 - Remove Duplicates from Sorted List II 083 - Remove Duplicates from Sorted List 096 - Unique Binary Search Trees 098 - Validate Binary Search Tree 101 - Symmetric Tree 105 - Construct Binary Tree from Preorder and Inorder Traversal 110 - Balanced Binary Tree 120 - Triangle 123 - Best Time to Buy and Sell Stock III 130 - Surrounded Regions 131 - Palindrome Partitioning 139 - Word Break 146 - LRU Cache 152 - Maximum Product Subarray 153 - Find Minimum in Rotated Sorted Array 155 - Min Stack 198 - House Robber 200 - Number of Islands 209 - Minimum Size Subarray Sum 213 - House Robber II 215 - Kth Largest Element in an Array 221 - Maximal Square 227 - Basic Calculator II 234 - Palindrome Linked List 236 - Lowest Common Ancestor of a Binary Tree 238 - Product of Array Except Self 260 - Single Number III 279 - Perfect Squares 287 - Find the Duplicate Number 300 - Longest Increasing Subsequence 309 - Best Time to Buy and Sell Stock with Cooldown 318 - Maximum Product of Word Lengths 322 - Coin Change 334 - Increasing Triplet Subsequence 368 - Largest Divisible Subset 376 - Wiggle Subsequence 377 - Combination Sum IV 378 - Kth Smallest Element in a Sorted Matrix 386 - Lexicographical Numbers 395 - Longest Substring with At Least K Repeating Characters 402 - Remove K Digits 406 - Queue Reconstruction by Height 413 - Arithmetic Slices 416 - Partition Equal Subset Sum 424 - Longest Repeating Character Replacement 435 - Non-overlapping Intervals 437 - Path Sum III 438 - Find All Anagrams in a String 442 - Find All Duplicates in an Array 448 - Find All Numbers Disappeared in an Array 451 - Sort Characters By Frequency 452 - Minimum Number of Arrows to Burst Balloons 454 - 4Sum II 456 - 132 Pattern 459 - Repeated Substring Pattern 462 - Minimum Moves to Equal Array Elements II 473 - Matchsticks to Square 474 - Ones and Zeroes 486 - Predict the Winner 494 - Target Sum 503 - Next Greater Element III 516 - Longest Palindromic Subsequence 518 - Coin Change 2 526 - Beautiful Arrangement 547 - Friend Circles 554 - Brick Wall 560 - Subarray Sum Equals K 567 - Permutation in String 576 - Out of Boundary Paths 561 - Shortest Unsorted Continuous Subarray 583 - Delete Operation for Two Strings 594 - Longest Harmonious Subsequence 645 - Set Mismatch 646 - Maximum Length of Pair Chain 647 - Palindromic Substrings 650 - 2 Keys Keyboard 652 - Find Duplicate Subtrees 654 - Maximum Binary Tree 658 - Find K Closest Elements 659 - Split Array into Consecutive Subsequences 662 - Maximum Width of Binary Tree 665 - Non-decreasing Array 670 - Maximum Swap 673 - Number of Longest Increasing Subsequence 678 - Valid Parenthesis String 698 - Partition to K Equal Sum Subsets 713 - Subarray Product Less Than K 714 - Best Time to Buy and Sell Stock with Transaction Fee 718 - Maximum Length of Repeated Subarray 719 - Find K-th Smallest Pair Distance 735 - Asteroid Collision 739 - Daily Temperatures 754 - Reach a Number 845 - Longest Mountain in Array 846 - Hand of Straights 930 - Binary Subarrays With Sum 979 - Distribute Coins in Binary Tree 994 - Rotting Oranges 1004 - Max Consecutive Ones III 1218 - Longest Arithmetic Subsequence of Given Difference 1349 - Maximum Students Taking Exam
全部评论
(1) 回帖