/Leetcode

New start

Primary LanguagePython

Leetcode

total:

easy(173/237+x) medium(144/437+x) hard(4/x)

Problem

1.Two Sum(dict)

7.(skip)(math)

9.(skip)(string trick)

11.Container with Most Water

12.(skip)(bad problem)

13.(skip)(brute force)

14.(skip)(bad problem)

17.Letter Combination of a Phone Number

20.Valid Parentheses

21.Merge Two LL

22.Generate Parentheses

24/LL.Swap Nodes in Pairs

26.(skip)(bad problem)

27.(skip)(bad problem)

29.(skip)(bad problem)

34.Find First and last element in an array

35.Search Insert Position

38.(skip)(bad problem)

39/Sum.Combination Sum

40/Sum.Combination Sum 2

46.Permutations(backstring)

47/46.Permutations 2

48.Rotate Matrix

49.Group Anagram

50.(skip)(bad problem)

53.Maximum Subarray

54/59.Spiral Matrix

55.Jump Game

57.Insert Intervals

58.(skip)(python trick)

59.Spiral Matrix 2(brute force)

62.Unique Paths

63/62.Unique Paths 2

64.Minimum Path Sum(dp)

66.(skip)(trick)

67.(skip)(bit manipulation)

69.(skip)(math)

70.Climbing Stairs

73.Set Matrix Zeroes

75.Sort Colors

77.Combinations

78.Subsets(backtracking)

80.(skip)(bad problem)

83.Remove duplicates from sorted LL

87.(skip)(bad problem)

88.(skip)(bad problem)

89.(skip)(bad problem)

90/78.Subsets 2

94/BT.BT Inorder Traversal

96/BST.Unique BST

100/BT.Same Tree

101.Symmetric Tree(two times traversal)

102/BT.BT level order Traversal

103/BT.BT zigzag Trversal

104.Maximum Depth of Binary Tree

105/BT.Construct BT from inorder and preorder traversal

106/BT.Construct BT from inorder and postorder traversal

107.(skip)(same as BFS)

108/BST.Convert sorted Array to BST

111.Minimum Depth

112/BT.Path Sum

113/BT.Path Sum 2

114/BT.Flattern Bt to LL

118.Pascal’s Triangle

119.Pascal’s Triangle 2 (-118)

122.(skip)(bad problem)

125.(skip)(bad problem)

129/BT.Sum Root to Leaf Numbers

131/Palindrome.Palindrome partition

136.Single Number

137.(skip)(bit manipulation)

141.LL Cycle

144/BT.BT Preorder Traversal

153.Find Minimum in Rotated Sorted Array

162.(skip)(bad problem)

165.(skip)(bad problem)

166.(skip)(bad problem)

167.Two Sum 2 - sorted array

168.(skip)(brute force)

169.(skip)(easy dict)

171.(skip)(brute force)

189.Rotate Array

191.(skip)(bit manipulation)

198.House Robber(dp)

199/BT.BT right side view

202.Happy Number

203.Remove Elements in LL

205.Isomorphic Strings

206.Reverse Linked List(LL base)

213/198.House Robber2(dp)

215.Kth Largest number in an array(to do again)

216.Combination Sum 3

217.Contain Duplicates 1 (skip)(dict)

219.Contain Duplicates 2

223.Rectangle Area

226.Invert Binary Tree

230/BST.K-th Smallest element in BST

231.Power of Two(skip)(easy)

234/LL.Palindrome LL

235.Lowest Common Ancestor of a BST

237.(skip)(bad problem)

238.Product of Array Except Self

240.Search a 2D matrix 2

242.(skip)(brute force)(dict)

257/BT.Binary Tree Path

258.(skip)(bad problem)

260.Single Number 3(skip)(to be optimized)

263.(skip)(bad problem)

268.(skip)(math)(bad problem)

274.(skip)(bad problem)

275.(skip)(bad problem)

278.Find bad version(binary search)

283.Move Zeroes

287.Find the Duplicate Number

290.Word Pattern (same as 205)

292.(skip)(bad problem)

300.Longest Increasing Subsequence

303.Range Sum Query

309.Best Time to Buy and Sell with Cooldown

319.(dkip)(bad problem)

322.Coin change(backpack problem)

326.(skip)(math)

328/LL.Odd Even LL

334.Increasing Triplet Subsequent

338.Counting Bits

342.Power of Four(skip)

343.Integer Break

344.Reverse String (skip)(python trick)

345.(skip)(bad problem)

347/451.Top K Frequent Elements(similar as 451)

349.(skip)(bad problem)

357.(skip)(bad problem)

365.(skip)(bad problem)

367.(skip)(trick)(binary search)

371.(skip)(bit manipulation)

372.(skip)(bad problem)

374.(skip)(bad problem)(binary search)

375.(skip)(bad problem)

377/Sum.Combination Sum 4

378.Kth smallest element in sorted matrix(heap)

383.(skip)(easy dict)

384.(skip)(bad problem)

386.(skip)(str-int tricl

387.First Unique Character in String(dict)

388.(skip)(bad problem)

389.Fine the Difference

390.(skip)(bad problem)

392.Is Subsequence

393.(skip)(bad problem)

397.(skip)(bad problem)

398.(skip)(bad problem)

400.(skip)(math

401.(skip)

404.Sum of Left Leaves

409/Palin.Longest Palindrome(count)(brute force)

412.Fizz Buzz (skip)(brute force)

414.(skip)(bad problem)

415.(skip)(底层操作)

416/698.Partition Equal Sum Subsets

420.(skip)(bad problem)

423.(skip)(bad problem)

424.Longest Repeating Char Replacement(slide window)

427.(skip)(bad)(dfs)

429.N-ary Tree Level Order Traversal

434.(skip)(bad problem)

435.Non-overlapping Interval

441.(skip)(bad problem)(math)

442/448.Find All Duplicates in an Array(similar as 448)

443.(skip)(bad broblem)(two pointer)

447.(skip)(bad problem)

448.Find all Numbers Disappeared in an Array

451.Sort Character By frequency

452.Minimum Number of Arrows to Burst Ballons(求交集)

453.(skip)(math problem)

455.Assign Cookies(two pointers)

458.(skip)(bad problem)(math)

459.Repeated Substring Pattern(trick)

461.Hamming Distance (To do)

462.(skip)(math)

463.Island Perimeter

470.Implement Rand10 using Rand7

474.Ones and Zeros

476.(skip)(bit manipulation)

477.Total Hamming Distance(skip)(bit manipulation)(string trick)

479.(skip)(bad problem)(math)

481.(skip)(bad problem)

482.(skip)(bad problem)

483.(skip)(bad problem)(math)

485.(skip) (brute force)

491/78.Increasing Subsequence

492.(skip)(brute force)

494/Sum.Target Sum

495.(skip)(bad problem)

496.Next Greater Element 1 (skip)

498.Diagonal Traverse(skip)

500.Keyboard Row (skip)(bad)

501.Find Mode in BST

503.Next Greater Element 2(stack)

504.base 7

506.(skip)(bad problem)

507.(skip)(math)

508/BT.Most Frequent Subtree Sum

513/BT.Find Bottom Left Tree Value(Similar as 637)(BFS)

515/BT.Find Largest value in each Tree Row(similar as 637)

516/Palin.Longest Palindrome Subsequence

518.Coin Change 2

520.(skip)(brute force)

521.(skip)(bad problem)

522.(skip)(bad problem)

524.Longest Word in Dic Trough Deleting

530.Minimum absolute Difference in BST

535.(skip)(bad problem)

537.(skip)(bad problem)

539.Minimum Time Difference

540.Single Element in Sorted Array

541.(skip)(bad problem)(brute force)

543.Diameter of Binary Tree

551.(skip)(bad problem)

553.(skip)(bad problem)

554.Brick Wall(hash table)

556.Reshape the Matrix

557.Reverse words in a String 3

558.(skip)(bad problem)

559.Maximum Depth of N-ary Tree

560.Subarray Sum Equal to K

561.Array Partition 1

563.Binary Tree Tilt(bad)

565.Array Nesting

575.Distribute Candies (skip)(bad)

583.Delete Operation for Two Strings

589.N-ary Tree Preorder Traversal

590.N-ary Tree Postorder Traversal

593.(skip)(bad problem)

594.Longest harmonious Subsequence(dict)

598.(skip)(brute force)

599.Min Index Sum of Two Lists(dict)(brute force)

617.Merge Two Binary Trees

622.Design Circular Queue

623/BT.Add One Row to Tree

633.Sum of Square Numbers

636.(skip)(bad problem)

637.Average of Levels in Binary Tree

638.(skip)(bad problem)

640.(skip)(bad problem)

643.Maximum Average Subarray 1

645.(skip)(dict)

646.Maximum Length of Pair Chain

647/Palin.Palindromic Substrings(dp)

650.2 Keys Keyboard(dp)

652/BT.Find Duplicate Subtrees

654.Maximum BT

655.(skip)(bad problem)

657.Robot Return To Origin (skip)(dict)

661.(skip)(bad problem)(brute force)

662/BT,Maximum width of BT

669.Trim a Binary Search Tree

670.Maximum Swap

671.Second Minimum Node In a BT

672.(skip)(bad problem)

674.Longest Continuous Increasing Subsequence(same as continuous ones)

680/Palin.Valid Palindrome 2

682.Baseball Game (skip)(bad)

686.Repeated String Match

690.(skip)(bad)

692.Top K Frequent Words

693.(skip)(bit manipulation)

697.Degree of an Array(brute force)(bad)

698.Partition to K equals sum subsets

700.Search in a Binary Searcch Tree

701/BST.Insert into a BST

704.Binary Search

705.Design Hashset

709.To Lower Case (skip)(bad)

717.(skip)(bad problem)

718.Maximum Length of Repeated Subarray(dp)(to do again)

720.(skip)(bad problem)

724.Find Pivot Index(trick)

725/LL.Split LL in Parts

728.Self Dividing Numbers

739.Daily Temperature(stack)

740.Delete and Earn

744.(skip)(binary search)

747.(skip)(dict)(brute force)

748.(skip)(bad problem)

762.(skip)(bit manipulation)

763.Partition Labels

766.Toeplitz Matrix

771.Jewels and Stones

781.(skip)(math)

783.(skip)(same with 530)

784.Letter Case Permutation

788.(skip)(bad problem)

789.(skip)(bad problem)(math)

791.Custom Sort String

795.Number of Subarray with Bounded Maximum

796.Rotate String (trick)

804.Unique Morse Code Words (skip)(brute force)

806.Number of Lines To Write String (skip)(bad)

808.(skip)(bad problem)

809.(skip)(bad problem)

811.Subdomain Visit Count (skip) (brute force)

812.(skip)(bad problem)

814/BT.BT prunning

816.(skip)(bad problem)

817.(skip)(bad problem)

819.(skip)(bad problem)

820.Short Encoding of Words

821.Shortest Distance to a Character

822.(skip)(bad problem)

824.(skip)(brute force)

825.(skip)(bad problem)

830.Position of Large Groups(mind the margin)

831.(skip)(bad problem)

832.Flipping an Image

833.(skip)(bad problem)

836.Rectangle Overlap

840.(skip)(bad problem)

844.Backspace String(stack)

846.Hand of Straights

849.Maximum Distance to Closet Person

851.Loud and Rich(skip)(bad problem)

852.Peak Index in a Mountain Array (skip)(bad problem)

856.Score of Parentheses

858.(skip)(math)

859.Buddy String

860.Lemonade Change(brute force)

866.(skip)(bad problem)

868.Binary Gap (skip)(bin manipulation)

872.Leaf-similar Trees

874.(skip)(bad problem)

876.Middle of the Linked List

883.Projection Area of 3D shapes

884.Uncommon Words from Two Sentences

888.Fair Candy Swap

889/BT.Construct BT from pre and post traversal

890/205.Find and Replace Pattern(based on 205)

893.Groups of Special-Equivalent Strings

896.Monotonic Array

908.(skip)(bad problem)

909.(skip)(bad problem)

915.Partition Array into Disjoint Intervals

917.Reverse Only Letters