美文网首页
LeetCode 解题攻略——Kotlin

LeetCode 解题攻略——Kotlin

作者: 糕冷羊 | 来源:发表于2019-07-18 20:46 被阅读0次

引言

这篇文章的输出并不是作者计划好的,它来源于作者的一个习惯。这个习惯就是每周都会解决一道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
530 Minimum Absolute Difference in BST
645 Set Mismatch
1221 Split a String in Balanced Strings
1252 Cells with Odd Values in a Matrix
189 Rotate Array
896 Monotonic Array
1013 Partition Array Into Three Parts With Equal Sum
172 Factorial Trailing Zeroes
237 Delete Node in a Linked List
1185 Day of the Week
917 Reverse Only Letters
811 Subdomain Visit Count
1184 Distance Between Bus Stops

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
1038 Binary Search Tree to Greater Sum Tree
380 Insert Delete GetRandom O(1)
516 Longest Palindromic Subsequence
1008 Construct Binary Search Tree from Preorder Traversal
93 Restore IP Addresses
912 Sort an Array
63 Unique Paths II
910 Smallest Range II
109 Convert Sorted List to Binary Search Tree
64 Minimum Path Sum
1282 Group the People Given the Group Size They Belong To
43 Multiply Strings
990 Satisfiability of Equality Equations
655 Print Binary Tree
260 Single Number III
1238 Circular Permutation in Binary Representation
667 Beautiful Arrangement II
1006 Clumsy Factorial
113 Path Sum II
769 Max Chunks To Make Sorted
962 Maximum Width Ramp
462 Minimum Moves to Equal Array Elements II
98 Validate Binary Search Tree
1395 Count Number of Teams
1315 Sum of Nodes with Even-Valued Grandparent
1637 Widest Vertical Area Between Two Points Containing No Points
1302 Deepest Leaves Sum
1329 Sort the Matrix Diagonally
1325 Delete Leaves With a Given Value

Hard

# Title
57 Insert Interval
446 Arithmetic Slices II - Subsequence
410 Split Array Largest Sum
51 N-Queens
928 Minimize Malware Spread II
943 Find the Shortest Superstring
312 Burst Balloons
330 Patching Array
1206 Design Skiplist
32 Longest Valid Parentheses

总结

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

相关文章

网友评论

      本文标题:LeetCode 解题攻略——Kotlin

      本文链接:https://www.haomeiwen.com/subject/sivrlctx.html