The Wayback Machine - https://web.archive.org/web/20200904195955/https://github.com/ja153903/LeetCode/
Skip to content
master
Go to file
Code

README.md

LeetCode

About

This project will contain solutions and unit tests in Go to questions on LeetCode.

There will be duplicate solutions to questions as I am organizing them by some theme rather than by question.

For example, I currently have a package for all questions inside the Top 100 Liked Questions category. As I expand, I expect to have packages for other types of questions. Most likely themes will be by company and by data structure/algorithm

Running Test Suite

To run unit test, you can run it at the package level or you can run it from the root directory.

Just run go test ./...

Solved Problems

In the following tables, the Solved? column refers to whether I have passed the online judge at LeetCode and not whether the solution has passed my unit tests. In the case that the solution I can think of does not pass the online judge, I will mark it with a

Top 100 Liked Questions

Question Difficulty Solved? Tests? Topics
Merge Two Binary Trees (#617) Easy ✔️ ✔️ Trees, Recursion
Maximum Depth of Binary Tree (#104) Easy ✔️ ✔️ Trees, Recursion
Single Number (#136) Easy ✔️ ✔️ Bit Manipulation
Invert Binary Tree (#226) Easy ✔️ ✔️ Trees, Recursion
Reverse Linked List (#206) Easy ✔️ ✔️ Linked Lists
Move Zeros (#283) Easy ✔️ ✔️ Arrays
Majority Element (#169) Easy ✔️ ✔️ Arrays, Maps
Find All Numbers Disappeared in an Array (#448) Easy ✔️ ✔️ Arrays, Maps
Merge Two Sorted Lists (#21) Easy ✔️ ✔️ Linked Lists
Best Time to Buy and Sell Stock (#121) Easy ✔️ ✔️ Arrays
Two Sum (#1) Easy ✔️ ✔️ Arrays, Maps
Add Two Numbers (#2) Medium ✔️ ✔️ Linked Lists
Longest Substring Without Repeating Characters (#3) Medium ✔️ ✔️ Strings
Maximum Subarray (#23) Easy ✔️ ✔️ Arrays
Valid Parenthesis (#20) Easy ✔️ ✔️ Stack, Arrays, Maps
Climbing Stairs (#70) Easy ✔️ ✔️ Arrays, Dynamic Programming
Generate Parentheses (#22) Medium ✔️ ✔️ Arrays, Recursion, Backtracking

Amazon

Question Difficulty Solved? Tests? Topics
Maximum Difference between Node and Ancestor (#1026) Medium ✔️ Recursion, Trees, Depth First Search
You can’t perform that action at this time.