My answers for leetcode questions
Go to file
Gleb Koval cbcd0a685a
cleanup
2022-09-01 12:41:00 +00:00
.devcontainer cleanup 2022-09-01 12:41:00 +00:00
.vscode cleanup 2022-09-01 12:41:00 +00:00
3sum 3sum 2022-06-10 11:55:12 +01:00
arranging-coins arranging-coins 2021-11-05 15:40:01 +00:00
best-time-to-buy-and-sell-stock some more problems 2022-05-30 23:03:12 +01:00
best-time-to-buy-and-sell-stock-ii best-time-to-buy-and-sell-stock-ii 2021-11-10 14:44:37 +00:00
binary-search binary-search 2022-06-11 12:44:37 +01:00
binary-tree-cameras some more problems 2022-06-19 22:57:33 +01:00
binary-tree-inorder-traversal catch-up 2022-06-09 15:45:14 +01:00
binary-tree-level-order-traversal catch-up 2022-06-09 15:45:14 +01:00
binary-tree-postorder-traversal catch-up 2022-06-09 15:45:14 +01:00
binary-tree-preorder-traversal catch-up 2022-06-09 15:45:14 +01:00
binary-tree-right-side-view binary-tree-right-side-view 2022-07-11 21:03:55 +01:00
candy uncommited problems 2022-07-06 00:33:16 +01:00
check-if-a-string-contains-all-binary-codes-of-size-k check-if-a-string-contains-all-binary-codes-of-size-k 2022-05-31 20:04:54 +01:00
contains-duplicate contains duplicate in 3 more languages for some reason 2022-05-29 21:00:01 +01:00
count-vowel-substrings-of-a-string count-vowel-substrings-of-a-string 2021-11-09 16:40:44 +00:00
daily-temperatures A few problems 2022-05-29 20:21:38 +01:00
delete-operation-for-two-strings some more problems 2022-06-19 22:57:33 +01:00
divide-two-integers some more problems 2022-05-30 23:03:12 +01:00
fibonacci-number fibonacci-number/ 2022-07-06 21:05:27 +01:00
first-bad-version first-bad-version 2021-11-05 15:09:36 +00:00
first-missing-positive maximum-erasure-value 2022-06-12 12:43:26 +01:00
first-unique-character-in-a-string first-unique-character-in-a-string 2022-06-02 23:43:47 +01:00
guess-number-higher-or-lower guess-number-higher-or-lower 2022-06-11 12:44:46 +01:00
implement-queue-using-stacks catch-up 2022-06-09 15:45:14 +01:00
insert-into-a-binary-search-tree catch-up 2022-06-09 15:45:14 +01:00
intersection-of-two-arrays-ii some more problems 2022-05-30 23:03:12 +01:00
intersection-of-two-linked-lists intersection-of-two-linked-lists 2022-06-06 19:51:38 +01:00
invert-binary-tree catch-up 2022-06-09 15:45:14 +01:00
jump-game-vi jump-game-vi 2022-07-09 23:34:05 +01:00
linked-list-cycle some more problems solved 2022-06-04 12:25:07 +01:00
longest-consecutive-sequence removed 1 map 2022-07-06 21:04:31 +01:00
longest-palindromic-substring some more problems 2022-06-19 22:57:33 +01:00
longest-string-chain some more problems 2022-06-19 22:57:33 +01:00
longest-substring-without-repeating-characters longest-substring-without-repeating-characters 2022-06-10 11:55:17 +01:00
longest-valid-parentheses A few problems 2022-05-29 20:21:38 +01:00
lowest-common-ancestor-of-a-binary-search-tree lowest-common-ancestor-of-a-binary-search-tree 2022-06-10 13:57:54 +01:00
maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts uncommited problems 2022-07-06 00:33:16 +01:00
maximum-depth-of-binary-tree catch-up 2022-06-09 15:45:14 +01:00
maximum-erasure-value maximum-erasure-value 2022-06-12 12:43:26 +01:00
maximum-path-quality-of-a-graph maximum-path-quality-of-a-graph 2021-11-10 14:32:05 +00:00
maximum-points-you-can-obtain-from-cards maximum-points-you-can-obtain-from-cards 2022-06-26 16:42:17 +01:00
maximum-product-of-word-lengths A few problems 2022-05-29 20:21:38 +01:00
maximum-subarray A few problems 2022-05-29 20:21:38 +01:00
maximum-units-on-a-truck uncommited problems 2022-07-06 00:33:16 +01:00
merge-sorted-array A few problems 2022-05-29 20:21:38 +01:00
merge-two-sorted-lists some more problems solved 2022-06-04 12:25:07 +01:00
middle-of-the-linked-list middle-of-the-linked-list 2021-11-09 15:56:54 +00:00
min-cost-climbing-stairs min-cost-climbing-stairs 2022-07-10 03:15:01 +01:00
minimum-deletions-to-make-character-frequencies-unique uncommited problems 2022-07-06 00:33:16 +01:00
minimum-operations-to-reduce-x-to-zero minimum-operations-to-reduce-x-to-zero 2022-06-11 12:44:55 +01:00
minimum-value-to-get-positive-step-by-step-sum minimum-value-to-get-positive-step-by-step-sum 2021-11-12 09:53:39 +00:00
missing-number A few problems 2022-05-29 20:21:38 +01:00
move-zeroes move-zeroes 2021-11-07 20:12:20 +00:00
multiply-strings removed main() from multiply-strings 2021-11-07 21:12:30 +00:00
n-queens n-queens 2022-06-04 23:47:01 +01:00
n-queens-ii n-queens-ii 2022-06-06 19:51:29 +01:00
non-decreasing-array non-decreasing-array 2022-06-26 16:42:44 +01:00
number-of-1-bits A few problems 2022-05-29 20:21:38 +01:00
number-of-steps-to-reduce-a-number-to-zero uncommited problems 2022-07-06 00:33:16 +01:00
number-of-valid-words-for-each-puzzle number-of-valid-words-for-each-puzzle 2021-11-09 02:07:53 +00:00
partitioning-into-minimum-number-of-deci-binary-numbers uncommited problems 2022-07-06 00:33:16 +01:00
pascals-triangle pascals-triangle 2022-05-31 23:24:52 +01:00
path-sum catch-up 2022-06-09 15:45:14 +01:00
prefix-and-suffix-search some more problems 2022-06-19 22:57:33 +01:00
product-of-array-except-self product-of-array-except-self 2021-11-05 12:53:13 +00:00
queue-reconstruction-by-height uncommited problems 2022-07-06 00:33:16 +01:00
range-sum-query-2d-immutable some more problems solved 2022-06-04 12:25:07 +01:00
ransom-note ransom-note 2022-06-02 23:43:57 +01:00
remove-duplicates-from-sorted-list remove-duplicates-from-sorted-list 2022-06-04 23:46:52 +01:00
remove-linked-list-elements some more problems solved 2022-06-04 12:25:07 +01:00
remove-nth-node-from-end-of-list remove-nth-node-from-end-of-list 2021-11-09 16:10:49 +00:00
remove-palindromic-subsequences catch-up 2022-06-09 15:45:14 +01:00
reshape-the-matrix reshape-the-matrix 2022-05-31 22:54:52 +01:00
reverse-linked-list reverse-linked-list 2022-06-04 23:46:41 +01:00
reverse-string reverse-string 2021-11-08 13:00:57 +00:00
reverse-words-in-a-string-iii reverse-words-in-a-string-iii 2021-11-08 19:34:36 +00:00
rotate-array rotate-array 2021-11-07 20:06:26 +00:00
rotate-image A few problems 2022-05-29 20:21:38 +01:00
running-sum-of-1d-array running-sum-of-1d-array 2022-06-01 14:04:19 +01:00
search-a-2d-matrix search-a-2d-matrix 2022-06-02 23:44:07 +01:00
search-in-a-binary-search-tree catch-up 2022-06-09 15:45:14 +01:00
search-insert-position search-insert-position 2022-06-12 14:07:59 +01:00
search-suggestions-system some more problems 2022-06-19 22:57:33 +01:00
single-number-iii single-number-iii 2021-11-10 15:12:32 +00:00
squares-of-a-sorted-array squares-of-a-sorted-array 2021-11-07 19:45:34 +00:00
string-to-integer-atoi string-to-integer-atoi 2021-11-09 11:42:53 +00:00
sum-of-left-leaves sum-of-left-leaves 2021-11-05 16:02:35 +00:00
symmetric-tree catch-up 2022-06-09 15:45:14 +01:00
tenth-line A few problems 2022-05-29 20:21:38 +01:00
transpose-file A few problems 2022-05-29 20:21:38 +01:00
transpose-matrix transpose-matrix 2022-06-02 23:44:15 +01:00
triangle triangle 2022-06-13 19:19:48 +01:00
two-sum A few problems 2022-05-29 20:21:38 +01:00
two-sum-ii-input-array-is-sorted catch-up 2022-06-09 15:45:14 +01:00
two-sum-iv-input-is-a-bst two-sum-iv-input-is-a-bst 2022-06-10 13:58:01 +01:00
unique-binary-search-trees unique-binary-search-trees 2021-11-08 12:56:51 +00:00
valid-anagram valid-anagram 2022-06-02 23:45:04 +01:00
valid-parentheses valid-parentheses 2022-06-06 19:51:18 +01:00
valid-sudoku some more problems solved 2022-06-04 12:25:07 +01:00
validate-binary-search-tree validate-binary-search-tree 2022-06-10 13:58:11 +01:00
wiggle-subsequence uncommited problems 2022-07-06 00:33:16 +01:00
word-frequency A few problems 2022-05-29 20:21:38 +01:00
.gitignore cleanup 2022-09-01 12:41:00 +00:00
README.md readme update 2022-07-15 20:37:50 +00:00

README.md

Gleb's leetcode solutions

These are most of my solutions to various leetcode 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.

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>/

All solutions for the various languages are named sol.<ext>, although generally I don't vary all that much.

If I have written multiple solutions in a language, 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.