chore: add package level comments
This commit is contained in:
parent
cc87c4b30c
commit
ee1868a10e
303 changed files with 303 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
// Package q100 implements a solution for https://leetcode.com/problems/same-tree/
|
||||
package q100
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q101 implements a solution for https://leetcode.com/problems/symmetric-tree/
|
||||
package q101
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q102 implements a solution for https://leetcode.com/problems/binary-tree-level-order-traversal/
|
||||
package q102
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q103 implements a solution for https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/
|
||||
package q103
|
||||
|
||||
import "slices"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q104 implements a solution for https://leetcode.com/problems/maximum-depth-of-binary-tree/
|
||||
package q104
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q105 implements a solution for https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
|
||||
package q105
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q106 implements a solution for https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/
|
||||
package q106
|
||||
|
||||
import "slices"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q108 implements a solution for https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
|
||||
package q108
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q110 implements a solution for https://leetcode.com/problems/balanced-binary-tree/
|
||||
package q110
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q112 implements a solution for https://leetcode.com/problems/path-sum/
|
||||
package q112
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q114 implements a solution for https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
|
||||
package q114
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q117 implements a solution for https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/
|
||||
package q117
|
||||
|
||||
type Node struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q118 implements a solution for https://leetcode.com/problems/pascals-triangle/
|
||||
package q118
|
||||
|
||||
func generate(numRows int) [][]int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q120 implements a solution for https://leetcode.com/problems/triangle/
|
||||
package q120
|
||||
|
||||
func minimumTotal(triangle [][]int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q125 implements a solution for https://leetcode.com/problems/valid-palindrome/
|
||||
package q125
|
||||
|
||||
func isAlphanumeric(c byte) bool {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q127 implements a solution for https://leetcode.com/problems/word-ladder/
|
||||
package q127
|
||||
|
||||
// Ideas for improvement: use a hashmap to index strings instead of an O(n^2)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q128 implements a solution for https://leetcode.com/problems/longest-consecutive-sequence/
|
||||
package q128
|
||||
|
||||
func longestConsecutive(nums []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q129 implements a solution for https://leetcode.com/problems/sum-root-to-leaf-numbers/
|
||||
package q129
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q130 implements a solution for https://leetcode.com/problems/surrounded-regions/
|
||||
package q130
|
||||
|
||||
func markI(board [][]byte, x, y int) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q133 implements a solution for https://leetcode.com/problems/clone-graph/
|
||||
package q133
|
||||
|
||||
type Node struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q134 implements a solution for https://leetcode.com/problems/gas-station/
|
||||
package q134
|
||||
|
||||
func canCompleteCircuit(gas []int, cost []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q135 implements a solution for https://leetcode.com/problems/candy/
|
||||
package q135
|
||||
|
||||
func candy(ratings []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q136 implements a solution for https://leetcode.com/problems/single-number/
|
||||
package q136
|
||||
|
||||
func singleNumber(nums []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q137 implements a solution for https://leetcode.com/problems/single-number-ii/
|
||||
package q137
|
||||
|
||||
func singleNumber(nums []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q138 implements a solution for https://leetcode.com/problems/copy-list-with-random-pointer/
|
||||
package q138
|
||||
|
||||
type Node struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q139 implements a solution for https://leetcode.com/problems/word-break/
|
||||
package q139
|
||||
|
||||
func wordBreak(s string, wordDict []string) bool {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q141 implements a solution for https://leetcode.com/problems/linked-list-cycle/
|
||||
package q141
|
||||
|
||||
type ListNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q142 implements a solution for https://leetcode.com/problems/linked-list-cycle-ii/
|
||||
package q142
|
||||
|
||||
type ListNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q144 implements a solution for https://leetcode.com/problems/binary-tree-preorder-traversal/
|
||||
package q144
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q145 implements a solution for https://leetcode.com/problems/binary-tree-postorder-traversal/
|
||||
package q145
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q146 implements a solution for https://leetcode.com/problems/lru-cache/
|
||||
package q146
|
||||
|
||||
type lruNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q148 implements a solution for https://leetcode.com/problems/sort-list/
|
||||
package q148
|
||||
|
||||
import "slices"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q150 implements a solution for https://leetcode.com/problems/evaluate-reverse-polish-notation/
|
||||
package q150
|
||||
|
||||
import "strconv"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q151 implements a solution for https://leetcode.com/problems/reverse-words-in-a-string/
|
||||
package q151
|
||||
|
||||
import "strings"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q153 implements a solution for https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
|
||||
package q153
|
||||
|
||||
func findMin(nums []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q155 implements a solution for https://leetcode.com/problems/min-stack/
|
||||
package q155
|
||||
|
||||
type stackElem struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q162 implements a solution for https://leetcode.com/problems/find-peak-element/
|
||||
package q162
|
||||
|
||||
// Important constraint: nums[i] != nums[i + 1]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q167 implements a solution for https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
|
||||
package q167
|
||||
|
||||
func twoSum(numbers []int, target int) []int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q172 implements a solution for https://leetcode.com/problems/factorial-trailing-zeroes/
|
||||
package q172
|
||||
|
||||
// Note: actually, counting 5 alone is enough since 2 certainly occurs more than 5.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q173 implements a solution for https://leetcode.com/problems/binary-search-tree-iterator/
|
||||
package q173
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q190 implements a solution for https://leetcode.com/problems/reverse-bits/
|
||||
package q190
|
||||
|
||||
func reverseBits(n int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q191 implements a solution for https://leetcode.com/problems/number-of-1-bits/
|
||||
package q191
|
||||
|
||||
func hammingWeight(n int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q198 implements a solution for https://leetcode.com/problems/house-robber/
|
||||
package q198
|
||||
|
||||
func rob(nums []int) int {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// Package q199 implements a solution for https://leetcode.com/problems/binary-tree-right-side-view/
|
||||
package q199
|
||||
|
||||
type TreeNode struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue