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

相關文章
相關標籤/搜索