This repository contains my solutions to various LeetCode problems written in Go. Each solution is contained in its own file named after the problem title in kebab case.
The repository is organized as follows:
leetcode.git
add-binary.go
binary-tree-inorder-traversal.go
maximum-depth-of-binary-tree.go
...
Each file in the repository represents a different LeetCode problem. The file name is based on the URL of the problem, converted to kebab case and with a .go
extension. Within each file, you'll find the solution code and any necessary comments to explain the thought process behind the solution.
If you're also studying for LeetCode, you can use this repository as a reference for your own solutions. To use the code in this repository, simply clone the repository to your local machine:
git clone https://github.com/oarriet/leetcode.git
Once you have the repository on your local machine, you can run each solution using the Go compiler. To do this, navigate to the file, uncomment main
func and run the following command:
go run .
If you have a solution to a LeetCode problem in Go that you'd like to contribute, please feel free to submit a pull request. However, please make sure that your solution meets the following criteria:
- The solution is written in Go.
- The file name is based on the URL of the problem, converted to kebab case and with a
.go
extension. - The solution includes any necessary comments to explain the thought process behind the solution.
This repository is licensed under the MIT license. See the LICENSE
file for more details.