Skip to content

ZhiweiYan-96/leetcode_solution

Repository files navigation

My solution for leetcode problems.

Some opensource file for leetcode solution.
For discussion, please email to me: yanzhw5@mail2.sysu.edu.cn

Problem solved:

Easy 17 (2020-01-26) Normal 23 (2020-02-26)

Rank: 95470, Acc rate: 22.66% (2020-02-24)

Rank: 89801, Acc rate: 22.85% (2020-02-26)

Rank: 53798, Acc rate: 30.17% (2020-05-08)

Miscellaneous

Problem 1: Two Sum

Problem 7: Reverse Integer

Problem 26: Remove Duplicates

(Normal) Problem 6: ZigZag Converion

(Normal) Problem 8: String to Integer

(Normal) Problem 12: Integer to Roman

(Normal) Problem interview 56: Interview Problem 56

(Normal) Problem 59: Spiral Matrix II

(Normal) Problem 73: Set Matrix Zeroes 🐷(review) ⏰(link)

  • O(n^2)
  • O(n)
  • O(1)

Stack

Problem 682: Baseball Game

Porblem 1046: Last Stone Weights

Heap

Problem 703: Kth Largest Element in a Stream 👽(Need review)

Dynamic Programming

Problem 70: Climbing Stairs

Problem 1025: Divisor Game

(Normal) Problem 5: Longest Palindromic Substring 🐷 (Need review)

  • Brute force
  • Dynamic programming

TODO:

  • Expand around center
  • Manacher's Algorithm

Problem 53: Maximum Subarray 🐷(Need review) ⏰(Link)

Greedy

Problem 122: Best Time to Buy and Sell Stock

Problem 860: Lemonade Change

Problem 1029: Two City Scheduling

Problem 1217: Play with Chips

Problem 1221: Split a String in a Balanced String

(Normal) Problem 807: Max Increase to Keep City Skyline

BFS/DFS

(Normal) Problem 17: Letter Combinations of a Phone Number

(Normal) Problem 78: Subsets 🐷(Need review)

(Normal) Problem 797: All Paths From Source to Target 🐷(Need review)

(Normal) Problem 1302: Deepest Leaves Sum

(Normal) Problem 1315: Sum of Nodes with Even-Valued Grandparent

Hash Table

(Normal) Problem 36: Valid Sudoku

  • Brute force

TODO:

  • Hash table

(Normal) Problem 1282: Group the People Given the Group Size They Belong To 👽(Need review)

Recursion

(Normal) Problem 654: Maximum Binary Tree

Linked List

(Normal) Problem 2: Add Two Numbers

(Normal) Problem 19: Remove Nth Node From End of List

(Normal) Problem 24: Swap Nodes in Pairs

TO ADD:

  • Dummy nodes

Two Pointers

(Normal) Problem 11: Container With Most Water

(Normal) Problem 3: Longest Substring Without Repeating Characters

  • Sliding window

TO ADD:

  • Optimized sliding window
  • Brute force

Problem 26: Remove Duplicates from Sorted Array

Problem 28: Implement strStr() 🐷(review) ⏰(link)

TO ADD:

  • Two pointers
  • Rabin Karp

Binary Search

Problem 35: Search Insert Position

(Normal)Problem 34: Find First and Last Position of Element in Sorted Array

Bit Manipulation

(Normal) Problem 338: Counting Bits

TO ADD:

  • Dynamic programming

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages