LeetCode 解题攻略——Kotlin

引言

这篇文章的输出并非做者计划好的,它来源于做者的一个习惯。这个习惯就是每周都会解决一道LeetCode的题目,从毕业至今一直保持着。最近忽然发现每周的一道题和一篇解题思路的文章已经累积到60+,因而水到渠成地决定写下这篇汇总文章,既是对过去的总结,也但愿能对他人有一些启发。算法

汇总

已经完成的LeetCode题目按问题难度汇总到下方的表格,分为Easy/Medium/Hard三部分,Title列点击题目能够跳转到该题答案和解题思路。数据结构

Easy

# Title
717 1-bit and 2-bit Characters
804 Unique Morse Code Words
929 Unique Email Addresses
653 Two Sum IV - Input is a BST
709 To Lower Case
404 Sum of Left Leaves
905 Sort Array By Parity
922 Sort Array By Parity II
700 Search in a Binary Search Tree
938 Range Sum of BST
883 Projection Area of 3D Shapes
762 Prime Number of Set Bits in Binary Representation
852 Peak Index in a Mountain Array
876 Middle of the Linked List
771 Jewels and Stones
897 Increasing Order Search Tree
832 Flipping an Image
744 Find Smallest Letter Greater Than Target
760 Find Anagram Mappings
448 Find All Numbers Disappeared in an Array
942 DI String Match
944 Delete Columns to Make Sorted
696 Count Binary Substrings
538 Convert BST to Greater Tree
606 Construct String from Binary Tree
961 N-Repeated Element in Size 2N Array
977 Squares of a Sorted Array
965 Univalued Binary Tree
509 Fibonacci Number
985 Sum of Even Numbers After Queries
933 Number of Recent Calls
821 Shortest Distance to a Character
872 Leaf-Similar Trees
908 Smallest Range I
1002 Find Common Characters
836 Rectangle Overlap
783 Minimum Distance Between BST Nodes
303 Range Sum Query - Immutable

Medium

# Title
861 Score After Flipping Matrix
950 Reveal Cards In Increasing Order
763 Partition Labels
921 Minimum Add to Make Parentheses Valid
807 Max Increase to Keep City Skyline
701 Insert into a Binary Search Tree
515 Find Largest Value in Each Tree Row
890 Find and Replace Pattern
814 Binary Tree Pruning
797 All Paths From Source to Target
894 All Possible Full Binary Trees
399 Evaluate Division
328 Odd Even Linked List
16 3Sum Closest
147 Insertion Sort List
802 Find Eventual Safe States
59 Spiral Matrix II
162 Find Peak Element
56 Merge Intervals
831 Masking Personal Information
725 Split Linked List in Parts
855 Exam Room
791 Custom Sort String

Hard

# Title
57 Insert Interval
446 Arithmetic Slices II - Subsequence
410 Split Array Largest Sum
51 N-Queens
928 Minimize Malware Spread II

总结

不积跬步,无以致千里;不积小流,无以成江海。做者毕业至今保持着每周一道LeetCode的习惯,不知不觉中已经完成了100+的题目。经过梳理题目,总结解题思路,解题的效率也愈来愈高,效果仍是很明显的。很推荐你们经过作LeetCode题目的方式保持思惟的活跃,从枯燥的业务中适当释放一下,既能提升逻辑思惟能力,也能提升对算法和数据结构的理解。app

相关文章
相关标签/搜索