学习工作之余,抽时间写了几道算法小题,不仅有助于转移思路,缓解工作压力,而且还能够扩展思路,毕竟脑袋是越用越灵活的 【笑】。
由于水平有限,只刷了部分easy和medium的题。现在将刷题目录记录于此,便于日后查找。
【0-100】
1、Two Sum
15、3Sum
16、3Sum Closest
18、4Sum
19、Remove Nth Node From End of List
21、Merge Two Sorted Lists
27、Remove Element
53、Maximum Subarray
62、 Unique Paths
67、Add Binary
73、Set Matrix Zeroes
79、Word Search
83、82、26、80 Remove Duplicates系列
98、Validate Binary Search Tree
【100-200】
102、Binary Tree Level Order Traversal
116、Populating Next Right Pointers in Each Node
118、Pascal’s Triangle
120、Triangle
125、Valid Palindrome
128、Longest Consecutive Sequence
141、Linked List Cycle
167、Two Sum II - Input array is sorted
169、Majority Element
171、Excel Sheet Column Number
172、Factorial Trailing Zeroes
【200-300】
202、Happy Number
203、Remove Linked List Elements
204、Count Primes
206、Reverse Linked List
221、Maximal Square
222、Count Complete Tree Nodes
224、Basic Calculator
225、Implement Stack using Queues
226、Invert Binary Tree
234、Palindrome Linked List
236、 Lowest Common Ancestor of a Binary Tree
237、Delete Node in a Linked List
263、Ugly Number
283、Move Zeroes
290、Word Pattern
292、Nim Game
【300-400】
347、Top K Frequent Elements
349、Intersection of Two Arrays
367、Valid Perfect Square
380、Insert Delete GetRandom O(1)
387、First Unique Character in a String
389、Find the Difference
【400-500】
415、Add Strings
435、Non-overlapping Intervals
448、Find All Numbers Disappeared in an Array
451、Sort Characters By Frequency
453、Minimum Moves to Equal Array Elements
462、Minimum Moves to Equal Array Elements II
463、Island Perimeter
485、Max Consecutive Ones
492、Construct the Rectangle
496、Next Greater Element I
【500+】
520、Detect Capital
523、Continuous Subarray Sum
530、Minimum Absolute Difference in BST
538、Convert BST to Greater Tree
561、Array Partition I
563、Binary Tree Tilt
575、Distribute Candies
599、Minimum Index Sum of Two Lists
606、Construct String from Binary Tree
617、Merge Two Binary Trees
637、Average of Levels in Binary Tree
653、Two Sum IV - Input is a BST
897. Increasing Order Search Tree
942. DI String Match