https://github.com/txfs19260817/leetcode-go
https://github.com/txfs19260817/leetcode-go
gitbook go leetcode
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/txfs19260817/leetcode-go
- Owner: txfs19260817
- Created: 2021-01-15T06:08:25.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2026-01-11T01:19:37.000Z (2 months ago)
- Last Synced: 2026-01-11T01:34:33.012Z (2 months ago)
- Topics: gitbook, go, leetcode
- Language: Go
- Homepage: https://txfs19260817.gitbook.io/leetcode-go-notes/
- Size: 17 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeetCode-Go-Notes
[](https://codecov.io/gh/txfs19260817/LeetCode-Go)
[](https://github.com/txfs19260817/LeetCode-Go/actions/workflows/go.yml)
## Index
### Array
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0031 | Next Permutation | [Go](solutions/31.-next-permutation.md) | Medium |
| 0048 | Rotate Image | [Go](solutions/48.-rotate-image.md) | Medium |
| 0073 | Set Matrix Zeroes | [Go](solutions/73.-set-matrix-zeroes.md) | Medium |
| 0240 | Search a 2D Matrix II | [Go](solutions/240.-search-a-2d-matrix-ii.md) | Medium |
| 0243 | Shortest Word Distance | [Go](solutions/243.-shortest-word-distance.md) | Easy |
| 0245 | Shortest Word Distance III | [Go](solutions/245.-shortest-word-distance-iii.md) | Medium |
| 0645 | Set Mismatch | [Go](solutions/645.-set-mismatch.md) | Easy |
| 0667 | Beautiful Arrangement II | [Go](solutions/667.-beautiful-arrangement-ii.md) | Medium |
| 1460 | Make Two Arrays Equal by Reversing Sub-arrays | [Go](solutions/1460.-make-two-arrays-equal-by-reversing-sub-arrays.md) | Easy |
| 1539 | Kth Missing Positive Number | [Go](solutions/1539.-kth-missing-positive-number.md) | Easy |
### Backtracking
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0131 | Palindrome Partitioning | [Go](solutions/131.-palindrome-partitioning.md) | Medium |
| 0403 | Frog Jump | [Go](solutions/403.-frog-jump.md) | Hard |
| 0784 | Letter Case Permutation | [Go](solutions/784.-letter-case-permutation.md) | Medium |
| 1302 | Deepest Leaves Sum | [Go](solutions/1302.-deepest-leaves-sum.md) | Medium |
| 1723 | Find Minimum Time to Finish All Jobs | [Go](solutions/1723.-find-minimum-time-to-finish-all-jobs.md) | Hard |
### Binary Search
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0034 | Find First and Last Position of Element in Sorted Array | [Go](solutions/34.-find-first-and-last-position-of-element-in-sorted-array.md) | Medium |
| 0069 | Sqrt\(x\) | [Go](solutions/69.-sqrt-x.md) | Easy |
| 0074 | Search a 2D Matrix | [Go](solutions/74.-search-a-2d-matrix.md) | Medium |
| 0153 | Find Minimum in Rotated Sorted Array | [Go](solutions/153.-find-minimum-in-rotated-sorted-array.md) | Medium |
| 0154 | Find Minimum in Rotated Sorted Array II | [Go](solutions/154.-find-minimum-in-rotated-sorted-array-ii.md) | Hard |
| 0367 | Valid Perfect Square | [Go](solutions/367.-valid-perfect-square.md) | Easy |
| 0410 | Split Array Largest Sum | [Go](solutions/410.-split-array-largest-sum.md) | Hard |
| 0436 | Find Right Interval | [Go](solutions/436.-find-right-interval.md) | Medium |
| 1011 | Capacity To Ship Packages Within D Days | [Go](solutions/1011.-capacity-to-ship-packages-within-d-days.md) | Medium |
| 1482 | Minimum Number of Days to Make m Bouquets | [Go](solutions/1482.-minimum-number-of-days-to-make-m-bouquets.md) | Medium |
### Bit Manipulation
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0187 | Repeated DNA Sequences | [Go](solutions/187.-repeated-dna-sequences.md) | Medium |
| 0231 | Power of Two | [Go](solutions/231.-power-of-two.md) | Easy |
| 0320 | Generalized Abbreviation | [Go](solutions/320.-generalized-abbreviation.md) | Medium |
| 0326 | Power of Three | [Go](solutions/326.-power-of-three.md) | Easy |
| 0342 | Power of Four | [Go](solutions/342.-power-of-four.md) | Easy |
| 0461 | Hamming Distance | [Go](solutions/461.-hamming-distance.md) | Easy |
| 0477 | Total Hamming Distance | [Go](solutions/477.-total-hamming-distance.md) | Medium |
| 0810 | Chalkboard XOR Game | [Go](solutions/810.-chalkboard-xor-game.md) | Hard |
| 1310 | XOR Queries of a Subarray | [Go](solutions/1310.-xor-queries-of-a-subarray.md) | Medium |
| 1318 | Minimum Flips to Make a OR b Equal to c | [Go](solutions/1318.-minimum-flips-to-make-a-or-b-equal-to-c.md) | Medium |
| 1442 | Count Triplets That Can Form Two Arrays of Equal XOR | [Go](solutions/1442.-count-triplets-that-can-form-two-arrays-of-equal-xor.md) | Medium |
| 1486 | XOR Operation in an Array | [Go](solutions/1486.-xor-operation-in-an-array.md) | Easy |
| 1707 | Maximum XOR With an Element From Array | [Go](solutions/1707.-maximum-xor-with-an-element-from-array.md) | Hard |
| 1720 | Decode XORed Array | [Go](solutions/1720.-decode-xored-array.md) | Easy |
| 1734 | Decode XORed Permutation | [Go](solutions/1734.-decode-xored-permutation.md) | Medium |
| 1738 | Find Kth Largest XOR Coordinate Value | [Go](solutions/1738.-find-kth-largest-xor-coordinate-value.md) | Medium |
### Design
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0146 | LRU Cache | [Go](solutions/146.-lru-cache.md) | Medium |
| 0225 | Implement Stack using Queues | [Go](solutions/225.-implement-stack-using-queues.md) | Easy |
| 0232 | Implement Queue using Stacks | [Go](solutions/232.-implement-queue-using-stacks.md) | Easy |
| 0244 | Shortest Word Distance II | [Go](solutions/244.-shortest-word-distance-ii.md) | Medium |
| 0460 | LFU Cache | [Go](solutions/460.-lfu-cache.md) | Hard |
### Dynamic Programming
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0087 | Scramble String | [Go](solutions/87.-scramble-string.md) | Hard |
| 0091 | Decode Ways | [Go](solutions/91.-decode-ways.md) | Medium |
| 0097 | Interleaving String | [Go](solutions/97.-interleaving-string.md) | Medium |
| 0132 | Palindrome Partitioning II | [Go](solutions/132.-palindrome-partitioning-ii.md) | Hard |
| 0303 | Range Sum Query - Immutable | [Go](solutions/303.-range-sum-query-immutable.md) | Easy |
| 0304 | Range Sum Query 2D - Immutable | [Go](solutions/304.-range-sum-query-2d-immutable.md) | Medium |
| 0329 | Longest Increasing Path in a Matrix | [Go](solutions/329.-longest-increasing-path-in-a-matrix.md) | Hard |
| 0368 | Largest Divisible Subset | [Go](solutions/368.-largest-divisible-subset.md) | Medium |
| 0377 | Combination Sum IV | [Go](solutions/377.-combination-sum-iv.md) | Medium |
| 0474 | Ones and Zeroes | [Go](solutions/474.-ones-and-zeroes.md) | Medium |
| 0494 | Target Sum | [Go](solutions/494.-target-sum.md) | Medium |
| 0583 | Delete Operation for Two Strings | [Go](solutions/583.-delete-operation-for-two-strings.md) | Medium |
| 0664 | Strange Printer | [Go](solutions/664.-strange-printer.md) | Hard |
| 1035 | Uncrossed Lines | [Go](solutions/1035.-uncrossed-lines.md) | Medium |
| 1139 | Largest 1-Bordered Square | [Go](solutions/1139.-largest-1-bordered-square.md) | Medium |
| 1143 | Longest Common Subsequence | [Go](solutions/1143.-longest-common-subsequence.md) | Medium |
| 1269 | Number of Ways to Stay in the Same Place After Some Steps | [Go](solutions/1269.-number-of-ways-to-stay-in-the-same-place-after-some-steps.md) | Hard |
### Greedy
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0045 | Jump Game II | [Go](solutions/45.-jump-game-ii.md) | Medium |
| 0135 | Candy | [Go](solutions/135.-candy.md) | Hard |
| 0435 | Non-overlapping Intervals | [Go](solutions/435.-non-overlapping-intervals.md) | Medium |
| 0455 | Assign Cookies | [Go](solutions/455.-assign-cookies.md) | Easy |
| 0936 | Stamping The Sequence | [Go](solutions/936.-stamping-the-sequence.md) | Hard |
### Hash Table
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0001 | Two Sum | [Go](solutions/1.-two-sum.md) | Easy |
| 0036 | Valid Sudoku | [Go](solutions/36.-valid-sudoku.md) | Medium |
| 0049 | Group Anagrams | [Go](solutions/49.-group-anagrams.md) | Medium |
| 0205 | Isomorphic Strings | [Go](solutions/205.-isomorphic-strings.md) | Easy |
| 0217 | Contains Duplicate | [Go](solutions/217.-contains-duplicate.md) | Easy |
| 0219 | Contains Duplicate II | [Go](solutions/219.-contains-duplicate-ii.md) | Easy |
| 0290 | Word Pattern | [Go](solutions/290.-word-pattern.md) | Easy |
| 0325 | Maximum Size Subarray Sum Equals k | [Go](solutions/325.-maximum-size-subarray-sum-equals-k.md) | Medium |
| 0525 | Contiguous Array | [Go](solutions/525.-contiguous-array.md) | Medium |
| 0554 | Brick Wall | [Go](solutions/554.-brick-wall.md) | Medium |
| 0560 | Subarray Sum Equals K | [Go](solutions/560.-subarray-sum-equals-k.md) | Medium |
| 0575 | Distribute Candies | [Go](solutions/575.-distribute-candies.md) | Easy |
| 0690 | Employee Importance | [Go](solutions/690.-employee-importance.md) | Easy |
| 0692 | Top K Frequent Words | [Go](solutions/692.-top-k-frequent-words.md) | Medium |
| 0953 | Verifying an Alien Dictionary | [Go](solutions/953.-verifying-an-alien-dictionary.md) | Easy |
| 1074 | Number of Submatrices That Sum to Target | [Go](solutions/1074.-number-of-submatrices-that-sum-to-target.md) | Hard |
| 1640 | Check Array Formation Through Concatenation | [Go](solutions/1640.-check-array-formation-through-concatenation.md) | Easy |
### Heap
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0215 | Kth Largest Element in an Array | [Go](solutions/215.-kth-largest-element-in-an-array.md) | Medium |
| 0347 | Top K Frequent Elements | [Go](solutions/347.-top-k-frequent-elements.md) | Medium |
| 0703 | Kth Largest Element in a Stream | [Go](solutions/703.-kth-largest-element-in-a-stream.md) | Easy |
### Linked List
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0002 | Add Two Numbers | [Go](solutions/2.-add-two-numbers.md) | Medium |
| 0021 | Merge Two Sorted Lists | [Go](solutions/21.-merge-two-sorted-lists.md) | Easy |
| 0082 | Remove Duplicates from Sorted List II | [Go](solutions/82.-remove-duplicates-from-sorted-list-ii.md) | Medium |
| 0083 | Remove Duplicates from Sorted List | [Go](solutions/83.-remove-duplicates-from-sorted-list.md) | Easy |
| 0445 | Add Two Numbers II | [Go](solutions/445.-add-two-numbers-ii.md) | Medium |
| 1721 | Swapping Nodes in a Linked List | [Go](solutions/1721.-swapping-nodes-in-a-linked-list.md) | Medium |
### Math
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0007 | Reverse Integer | [Go](solutions/7.-reverse-integer.md) | Easy |
| 0029 | Divide Two Integers | [Go](solutions/29.-divide-two-integers.md) | Medium |
| 0043 | Multiply Strings | [Go](solutions/43.-multiply-strings.md) | Medium |
| 0066 | Plus One | [Go](solutions/66.-plus-one.md) | Easy |
| 0067 | Add Binary | [Go](solutions/67.-add-binary.md) | Easy |
| 0204 | Count Primes | [Go](solutions/204.-count-primes.md) | Easy |
| 0263 | Ugly Number | [Go](solutions/263.-ugly-number.md) | Easy |
| 0264 | Ugly Number II | [Go](solutions/264.-ugly-number-ii.md) | Medium |
| 0470 | Implement Rand10\(\) Using Rand7\(\) | [Go](solutions/470.-implement-rand10-using-rand7.md) | Medium |
| 0523 | Continuous Subarray Sum | [Go](solutions/523.-continuous-subarray-sum.md) | Medium |
| 0781 | Rabbits in Forest | [Go](solutions/781.-rabbits-in-forest.md) | Medium |
| 1006 | Clumsy Factorial | [Go](solutions/1006.-clumsy-factorial.md) | Medium |
| 1551 | Minimum Operations to Make Array Equal | [Go](solutions/1551.-minimum-operations-to-make-array-equal.md) | Medium |
| 1744 | Can You Eat Your Favorite Candy on Your Favorite Day? | [Go](solutions/1744.-can-you-eat-your-favorite-candy-on-your-favorite-day.md) | Medium |
### Sort
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0220 | Contains Duplicate III | [Go](solutions/220.-contains-duplicate-iii.md) | Medium |
### Stack
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0020 | Valid Parentheses | [Go](solutions/20.-valid-parentheses.md) | Easy |
| 0084 | Largest Rectangle in Histogram | [Go](solutions/84.-largest-rectangle-in-histogram.md) | Hard |
| 0150 | Evaluate Reverse Polish Notation | [Go](solutions/150.-evaluate-reverse-polish-notation.md) | Medium |
| 0155 | Min Stack | [Go](solutions/155.-min-stack.md) | Easy |
| 0456 | 132 Pattern | [Go](solutions/456.-132-pattern.md) | Medium |
| 1190 | Reverse Substrings Between Each Pair of Parentheses | [Go](solutions/1190.-reverse-substrings-between-each-pair-of-parentheses.md) | Medium |
### String
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0012 | Integer to Roman | [Go](solutions/12.-integer-to-roman.md) | Medium |
| 0013 | Roman to Integer | [Go](solutions/13.-roman-to-integer.md) | Easy |
| 0032 | Longest Valid Parentheses | [Go](solutions/32.-longest-valid-parentheses.md) | Hard |
| 0038 | Count and Say | [Go](solutions/38.-count-and-say.md) | Easy |
| 0415 | Add Strings | [Go](solutions/415.-add-strings.md) | Easy |
| 1332 | Remove Palindromic Subsequences | [Go](solutions/1332.-remove-palindromic-subsequences.md) | Easy |
| 1614 | Maximum Nesting Depth of the Parentheses | [Go](solutions/1614.-maximum-nesting-depth-of-the-parentheses.md) | Easy |
| 1704 | Determine if String Halves Are Alike | [Go](solutions/1704.-determine-if-string-halves-are-alike.md) | Easy |
| 1796 | Second Largest Digit in a String | [Go](solutions/1796.-second-largest-digit-in-a-string.md) | Easy |
### Tree
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0116 | Populating Next Right Pointers in Each Node | [Go](solutions/116.-populating-next-right-pointers-in-each-node.md) | Medium |
| 0117 | Populating Next Right Pointers in Each Node II | [Go](solutions/117.-populating-next-right-pointers-in-each-node-ii.md) | Medium |
| 0208 | Implement Trie \(Prefix Tree\) | [Go](solutions/208.-implement-trie-prefix-tree.md) | Medium |
| 0331 | Verify Preorder Serialization of a Binary Tree | [Go](solutions/331.-verify-preorder-serialization-of-a-binary-tree.md) | Medium |
| 0440 | K-th Smallest in Lexicographical Order | [Go](solutions/440.-k-th-smallest-in-lexicographical-order.md) | Hard |
| 0450 | Delete Node in a BST | [Go](solutions/450.-delete-node-in-a-bst.md) | Medium |
| 0623 | Add One Row to Tree | [Go](solutions/623.-add-one-row-to-tree.md) | Medium |
| 0654 | Maximum Binary Tree | [Go](solutions/654.-maximum-binary-tree.md) | Medium |
| 0872 | Leaf-Similar Trees | [Go](solutions/872.-leaf-similar-trees.md) | Easy |
| 0897 | Increasing Order Search Tree | [Go](solutions/897.-increasing-order-search-tree.md) | Easy |
| 0938 | Range Sum of BST | [Go](solutions/938.-range-sum-of-bst.md) | Easy |
| 1469 | Find All The Lonely Nodes | [Go](solutions/1469.-find-all-the-lonely-nodes.md) | Easy |
### Two Pointers
| No. | Title | Solution | Difficulty |
| :--- | :--- | :--- | :--- |
| 0026 | Remove Duplicates from Sorted Array | [Go](solutions/26.-remove-duplicates-from-sorted-array.md) | Easy |
| 0080 | Remove Duplicates from Sorted Array II | [Go](solutions/80.-remove-duplicates-from-sorted-array-ii.md) | Medium |
| 0088 | Merge Sorted Array | [Go](solutions/88.-merge-sorted-array.md) | Easy |
| 0202 | Happy Number | [Go](solutions/202.-happy-number.md) | Easy |
| 0633 | Sum of Square Numbers | [Go](solutions/633.-sum-of-square-numbers.md) | Medium |
| 0881 | Boats to Save People | [Go](solutions/881.-boats-to-save-people.md) | Medium |
## Reference
1. [https://books.halfrost.com/leetcode](https://books.halfrost.com/leetcode)