GithubHelp home page GithubHelp logo

chen0040 / java-leetcode Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 4.0 861 KB

My daily LeetCode solutions

License: MIT License

Java 99.78% SQLPL 0.09% Shell 0.13%
leetcode leetcode-solutions leetcode-java programming-challenges programming-exercises

java-leetcode's Introduction

java-leetcode

My daily LeetCode solutions. Solutions were added on daily basis after i solved each problem.

The solutions were written while I was solving these problems during practice, therefore while the solutions were accepted in LeetCode on Submission, they may not represent the best solution and the source codes may not be optimized

Day 1 - Easy

  1. Array Partition I
  2. Big Countries
  3. Distribute Candies
  4. Hamming Distance
  5. Merge Two Binary Trees
  6. Number Complement
  7. Reshape the Matrix
  8. Reverse String
  9. Reverse Words in String III
  10. Swap Salary

Day 1 - Medium

  1. Battleships in a A Board
  2. Binary Search Tree Iterator
  3. Binary Tree Preorder Traversal
  4. Complex Number Multiplication
  5. Find Duplicate File in System
  6. Single Element in Sorted Array
  7. Sort Characters by Frequency
  8. Spiral Matrix
  9. Spiral Matrix II
  10. Top K Frequent Items

Day 2 - Easy

  1. Average Of Levels In Binary Tree
  2. Detect Capitals
  3. Find All Numbers Disappear in Array
  4. FizzBuzz
  5. Invert Binary Tree
  6. Island Parameter
  7. Max Consecutive Ones
  8. Next Greater Element
  9. Not Boring Movies
  10. Single Number
  11. Sum of Two Integers

Day 2 - Medium

  1. Add One Row To Tree Node
  2. Array Nesting
  3. Count Bits
  4. Find All Duplicates in Array
  5. Find Bottom Left Tree Value
  6. Friend Circles
  7. Inorder Traversal
  8. Largest Value in Each Tree Row
  9. Shuffle an Array
  10. Single Number III
  11. Total Hamming Distance

Day 3 - Easy

  1. Binary Tree Tilt
  2. Contains Duplicates
  3. Excel Sheet Column Numbers
  4. Find Unique Characters in String
  5. Majority Element
  6. Relative Ranks
  7. Reverse Linked List
  8. Same Trees
  9. Sum of Left Leaves
  10. Valid Anagram

Day 3 - Medium

  1. Most Frequent Subtree Sums
  2. Permutations
  3. Rotate Image

Day 4 - Easy

  1. Base 7
  2. Convert Sorted Array to Binary Search Tree
  3. Diameter of Binary Tree
  4. Maximum Product of 3 Numbers
  5. Missing Number
  6. Number of Boomerangs
  7. Read Binary Watch
  8. Reverse String II
  9. Student Attendance Record II

Day 4 - Medium

  1. Binary Tree Paths
  2. Binary Tree Right Side View
  3. Clone Graph
  4. Binary Tree to Linked List
  5. Number of Islands
  6. Subarray Sum equals to K
  7. Subsets
  8. Sum Root to Leaf Numbers
  9. Symmetric Tree
  10. Target Sum

Day 4 - Hard

  1. Binary Tree Maximum Path Sum

Day 5 - Easy

  1. Excel Sheet Column Title
  2. Linked List Cycle
  3. Longest Common Prefix
  4. Merge Two Sorted Lists
  5. Min Stack
  6. Panlindrome Number
  7. Reverse Integer
  8. Roman to Integer
  9. Second Highest Salary
  10. Sqrt(x)
  11. Valid Parentheses

Day 5 - Medium

  1. Generate Parentheses
  2. Integer to Roman
  3. Kth Largest Element in an array
  4. Letter Combinations of Phone Number
  5. Longest Panlindrome Substring
  6. Longest Substring without Repeating Characters
  7. Nth Highest Salary
  8. Remove Nth Node from End of List
  9. String to Integer
  10. Zig Zag Conversion

Day 6 - Easy

  1. Remove duplicates from sorted array
  2. Maximum Subarray
  3. Remove Element
  4. Implement strStr()
  5. Search Insert Position
  6. Count And Say
  7. Length of Last Word
  8. Plus One
  9. Add Binary
  10. Climb Stairs
  11. Remove Duplicates from Sorted List
  12. Merge Sorted Array
  13. Path Sum
  14. Pascal's Triangle
  15. Pascal's Triangle II
  16. Binary Level Order Traversal II
  17. Best Time to Buy and Sell Stock
  18. Best Time to Buy and Sell Stock II
  19. Valid Panlindrome
  20. Intersection of Two Linked Lists

Day 6 - Medium

  1. Swap Nodes in Pairs
  2. Search for a Range
  3. Search In Rotated Sorted Array
  4. Set Matrix Zeroes
  5. Sort Colors
  6. Group Anagrams
  7. Binary Tree Level Order Traversal
  8. Reverse Words in a String
  9. Linked List Cycle II
  10. Repeated DNA Sequence

Day 7 - Easy

  1. Two Sums - Input Array is Sorted
  2. Factorial Trailing Zeroes
  3. Employees earning more than their Managers
  4. Find Duplicate Emails
  5. Find Customers who never orders
  6. Rotate Array
  7. Reverse Bits
  8. Number of 1 Bits
  9. Valid Phone Numbers
  10. 10th Line
  11. Delete Duplicate Emails
  12. Rising Temperature
  13. House Robber
  14. Happy Number
  15. Remove Linked List Elements
  16. Contains Duplicates II
  17. Implement Stack using Queues
  18. Implement Queue using Stacks
  19. Power of Two
  20. Count Primes
  21. Panlindrome Linked List
  22. Add Digits

Day 7 - Medium

  1. Remove Duplicates from Sorted Array II
  2. Multiply Strings
  3. Word Search
  4. Simplify Path
  5. Search in Rotated Sorted Array II
  6. Permutations II
  7. Combination Sum
  8. Valid BST
  9. Unique Binary Search Trees
  10. Combinations
  11. Rotate List

Day 8 - Easy

  1. Ugly Number
  2. Delete Node in a Linked List
  3. Lowest Common Ancestor of a Binary Search Tree
  4. Find the difference
  5. Ransom Note
  6. Nth Digit
  7. Convert to Hexadecimal
  8. Add Strings
  9. Longest Panlindrome
  10. Third Max
  11. Number of Segments in a String

Day 8 - Medium

  1. Add Two Numbers II
  2. Valid Sudoku

Day 9 - Easy

  1. Move Zeroes
  2. Nim Game
  3. First Bad Version
  4. Reverse Vowels in a String
  5. Range Sum Query
  6. Power of Three
  7. Power of Four
  8. Valid Perfect Square
  9. Intersection of Two Arrays
  10. Intersection of Two Arrays II
  11. Guess Number High Or Low

Day 9 - Medium

  1. Construct Binary Tree from Preorder and Inorder Traversals

Day 10 - Easy

  1. Find All Anagrams
  2. Construct String from Binary Search Tree
  3. Set Mismatch
  4. Sum of Square Numbers
  5. Max Average Sub Array
  6. Can Place Flowers
  7. Minimum Index Sum
  8. Classes with more than 4 Students
  9. Heaters
  10. Convert BST to Greater Tree
  11. Subtree of Another Tree

Day 10 - Medium

  1. Bulb Switcher

Day 11 - Easy

  1. Two Sums IV - Tree is BST
  2. Largest Number

Day 11 - Medium

  1. Design Twitter
  2. Queue Reconstruction By Height
  3. Construct Maximum Binary Tree

Day 11 - Hard

  1. Maximum Gap

Day 12 - Easy

  1. Construct Rectangle

Day 12 - Medium

  1. Print Binary Tree
  2. Panlindromic Substrings

Day 14 - Easy

  1. Rearranging Coins
  2. Longest Harmonious Sequence
  3. Find Model in Binary Search Tree
  4. Shortest Unsorted Continuous Subarray
  5. Minimum Absolute Difference in BST
  6. K-diff Pairs in Array
  7. Minimum Moves to Equal Array Elements
  8. Assign Cookies
  9. Keyboard Row
  10. Poor Pigs

Day 14 - Medium

  1. Compare Version Numbers

Day 15 - Medium

  1. Count Numbers with Unique Digits
  2. 2 Keys Keyboard
  3. Dota2 Senate
  4. Replace Words
  5. Maximum Length of Pair Chain
  6. Solve The Equation
  7. Permutation in String
  8. Continuous Subarray Sum
  9. Continuous Array
  10. Minesweeper
  11. Integer Break
  12. Shopping Offers
  13. Minimum Path Sum
  14. Unique Paths
  15. Unique Paths II
  16. Search a 2D Matrix
  17. Search a 2D Matrix II
  18. Find the Duplicate Number
  19. Exclusive Time of Functions
  20. Exchange Seats

Day 16 - Medium

  1. Delete Node in a BST
  2. Task Scheduler
  3. Valid Triangle Number
  4. Valid Square
  5. Fraction to Recurring Decimal
  6. Rectangle Area
  7. Next Greater Element III
  8. Next Greater Element II
  9. Decode String
  10. Flatten Nested List Iterator
  11. MiniParser
  12. Minimum Time Difference
  13. 01 Matrix
  14. Sort List
  15. Insertion Sort List
  16. Copy List With Random Pointer
  17. Reconstruct Original Digits from English

Day 17 - Medium

  1. Diagonal Traversal
  2. Arithmetic Slices
  3. Fraction Addition and Subtraction
  4. Encode and Decode TinyURL
  5. Convert Sorted List to Binary Tree
  6. Verify Preorder Serialization of a Binary Tree
  7. Evaluate Reverse Polish Notation
  8. Partition List
  9. Reorder List
  10. Odd Even Linked List
  11. 3 Sum
  12. 3 Sum Closest
  13. Lexicographical Numbers
  14. Random Pick Index
  15. Linked List Random Node
  16. Evaluate Division
  17. Course Schedule
  18. Brick Wall
  19. Rank Scores
  20. Consecutive Numbers

Day 18 - Easy

  1. Judge Route Circle

Day 18 - Medium

  1. Beautiful Arrangement
  2. Peeking Iterator
  3. License Key Formatting
  4. Validate IP Address
  5. Find K Closest Element
  6. Validate UTF-8
  7. Kth Smallest Element in a BST
  8. Serialize and Deserialize BST
  9. Find Duplicate Subtrees
  10. Longest Absolute File Path
  11. Maximum Product of Word Length
  12. Single Number II
  13. Word Ladder
  14. Lowest Common Ancestor of Binary Tree
  15. Course Schedule II
  16. Summary Ranges
  17. Word Frequency
  18. Department Highest Salary
  19. Populating Next Right Pointer in Each Node
  20. Find Minimum in Rotated Sorted List

Day 19 - Easy

  1. Path Sum III
  2. Minimum Moves to Equal Array Elements
  3. Repeated Substring Patterns
  4. Largest Panlindrome Product

Day 19 - Medium

  1. Path Sum II
  2. Minimum Moves to Equal Array Elements II
  3. Longest Word in Dictionary Through Deleting

Day 20 - Hard

  1. LRU Cache
  2. LFU Cache

Day 20 - Medium

  1. Longest Substring with at least k Repeating Characters
  2. Pacific Atlantic Water Flow
  3. Implement Trie (Prefix Trie)
  4. Add and Search Word - Word Dictionary Design

Day 21 - Medium

  1. Largest Divisible Subset
  2. Partition Equal Subset Sum
  3. Permutation Sequence
  4. Next Permutation
  5. H-Index
  6. H-Index II

Day 25 - Easy

  1. [Image Smoother]

Day 25 - Medium

  1. [Equal Tree Partition]
  2. [Maximum Width of Binary Tree]

Day 25 - Hard

  1. Merge k Sorted Linked List

java-leetcode's People

Contributors

chen0040 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.