2021-11-05 12:27:07 +00:00
|
|
|
# Gleb's leetcode solutions
|
|
|
|
These are most of my solutions to various
|
|
|
|
[leetcode](https://leetcode.com) problems.
|
|
|
|
|
|
|
|
They are by no means the best solutions, rather
|
|
|
|
what I could come up with by myself.
|
|
|
|
|
|
|
|
In each solution I always aim for the lowest
|
|
|
|
possible time complexity first; however, there
|
|
|
|
may be multiple solutions for some problems to
|
|
|
|
try to minimise space complexity instead.
|
2021-11-05 12:52:08 +00:00
|
|
|
|
|
|
|
## Naming
|
|
|
|
Each folder is the name of the problem from its URL,
|
|
|
|
so the problem can be accessed at:
|
|
|
|
```
|
|
|
|
https://leetcode.com/problems/<folder-name>/
|
|
|
|
```
|
2022-05-31 00:23:00 +00:00
|
|
|
|
|
|
|
All solutions for the various languages are named
|
|
|
|
`sol.<ext>`, although generally I don't vary all that
|
2022-05-31 21:46:06 +00:00
|
|
|
much.
|
|
|
|
|
|
|
|
If I have written multiple solutions in a language,
|
2022-07-15 20:37:50 +00:00
|
|
|
they will be named `sol_<description>.<ext>`.
|
|
|
|
|
|
|
|
## Included & not included code
|
|
|
|
This is very inconsistent, but generally I will
|
|
|
|
include a `package main` in .go files, as well as
|
|
|
|
any extra struct / class definitions in all files.
|
|
|
|
Although a lot of the time I also don't do this.
|