README ¶
leetgo
LeetCode in Go, just for fun obviously
Problems
- s0001 two sum
- s0002 add two numbers
- s0003 longest substring without repeating characters
- s0005 longest palindromic substring
- s0006 zigzag conversion
- s0008 string to integer (atoi)
- s0011 container with most water
- s0013 roman to integer
- s0014 longest common prefix
- s0015 3sum
- s0016 3sum closest
- s0017 letter combinations of a phone number
- s0019 remove nth node from end of list
- s0020 valid parentheses
- s0021 merge two sorted lists
- s0022 generate parentheses
- s0023 merge k sorted lists
- s0024 swap nodes in pairs
- s0025 reverse nodes in k-group
- s0026 remove duplicates from sorted array
- s0027 remove element
- s0028 implement strstr()
- s0029 divide two integers
- s0032 longest valid parentheses
- s0033 search in rotated sorted array
- s0034 find first and last position of element in sorted array
- s0035 search insert position
- s0036 valid sudoku
- s0039 combination sum
- s0040 combination sum ii
- s0043 multiply strings
- s0045 jump game ii
- s0046 permutations
- s0047 permutations ii
- s0048 rotate image
- s0049 group anagrams
- s0051 n-queens
- s0052 n-queens ii
- s0053 maximum subarray
- s0054 spiral matrix
- s0055 jump game
- s0056 merge intervals
- s0057 insert interval
- s0058 length of last word
- s0059 spiral matrix ii
- s0061 rotate list
- s0063 unique paths ii
- s0064 minimum path sum
- s0066 plus one
- s0067 add binary
- s0070 climbing stairs
- s0072 edit distance
- s0074 search a 2d matrix
- s0075 sort colors
- s0077 combinations
- s0078 subsets
- s0079 word search
- s0082 remove duplicates from sorted list ii
- s0083 remove duplicates from sorted list
- s0086 partition list
- s0088 merge sorted array
- s0090 subsets ii
- s0092 reverse linked list ii
- s0093 restore ip addresses
- s0094 binary tree inorder traversal
- s0097 interleaving string
- s0098 validate binary search tree
- s0100 same tree
- s0101 symmetric tree
- s0102 binary tree level order traversal
- s0103 binary tree zigzag level order traversal
- s0104 maximum depth of binary tree
- s0105 construct binary tree from preorder and inorder traversal
- s0106 construct binary tree from inorder and postorder traversal
- s0108 convert sorted array to binary search tree
- s0109 convert sorted list to binary search tree
- s0110 balanced binary tree
- s0112 path sum
- s0113 path sum ii
- s0114 flatten binary tree to linked list
- s0116 populating next right pointers in each node
- s0117 populating next right pointers in each node ii
- s0118 pascals triangle
- s0119 pascals triangle ii
- s0120 triangle
- s0121 best time to buy and sell stock
- s0126 word ladder ii
- s0128 longest consecutive sequence
- s0129 sum root to leaf numbers
- s0130 surrounded regions
- s0131 palindrome partitioning
- s0134 gas station
- s0135 candy
- s0136 single number
- s0139 word break
- s0141 linked list cycle
- s0142 linked list cycle ii
- s0143 reorder list
- s0144 binary tree preorder traversal
- s0145 binary tree postorder traversal
- s0146 lru cache
- s0148 sort list
- s0149 max points on a line
- s0151 reverse words in a string
- s0153 find minimum in rotated sorted array
- s0155 Min Stack
- s0160 intersection of two linked lists
- s0162 find peak element
- s0167 two sum ii - input array is sorted
- s0169 majority element
- s0171 excel sheet column number
- s0173 binary search tree iterator
- s0187 repeated dna sequences
- s0189 rotate array
- s0190 reverse bits
- s0198 house robber
- s0199 binary tree right side view
- s0200 number of islands
- s0203 remove linked list elements
- s0206 reverse linked list
- s0208 implement trie (prefix tree)
- s0209 minimum size subarray sum
- s0211 design add and search words data structure
- s0212 word search ii
- s0213 house robber ii
- s0215 kth largest element in an array
- s0216 combination sum iii
- s0217 contains duplicate
- s0219 contains duplicate ii
- s0222 count complete tree nodes
- s0223 rectangle area
- s0225 implement stack using queues
- s0226 invert binary tree
- s0230 kth smallest element in a bst
- s0231 power of two
- s0232 implement queue using stacks
- s0234 palindrome linked list
- s0235 lowest common ancestor of a binary search tree
- s0236 lowest common ancestor of a binary tree
- s0237 delete node in a linked list
- s0238 product of array except self
- s0240 search a 2d matrix ii
- s0242 valid anagram
- s0256 paint house
- s0258 add digits
- s0263 ugly number
- s0268 missing number
- s0278 first bad version
- s0279 perfect squares
- s0283 move zeroes
- s0284 peeking iterator
- s0290 word pattern
- s0295 find median from data stream
- s0297 serialize and deserialize binary tree
- s0300 longest increasing subsequence
- s0304 range sum query 2d - immutable
- s0307 range sum query - mutable
- s0315 count of smaller numbers after self
- s0318 maximum product of word lengths
- s0322 coin change
- s0326 power of three
- s0328 odd even linked list
- s0329 longest increasing path in a matrix
- s0334 increasing triplet subsequence
- s0341 flatten nested list iterator
- s0342 power of four
- s0344 reverse string
- s0345 reverse vowels of a string
- s0347 top k frequent elements
- s0350 intersection of two arrays ii
- s0352 data stream as disjoint intervals
- s0354 russian doll envelopes
- s0374 guess number higher or lower
- s0376 wiggle subsequence
- s0377 combination sum iv
- s0378 kth smallest element in a sorted matrix
- s0382 linked list random node
- s0383 ransom note
- s0387 first unique character in a string
- s0389 find the difference
- s0392 is subsequence
- s0404 sum of left leaves
- s0406 queue reconstruction by height
- s0409 longest palindrome
- s0413 arithmetic slices
- s0414 third maximum number
- s0415 add strings
- s0427 construct quad tree
- s0429 n-ary tree level order traversal
- s0433 minimum genetic mutation
- s0435 non-overlapping intervals
- s0438 find all anagrams in a string
- s0443 string compression
- s0450 delete node in a bst
- s0451 sort characters by frequency
- s0452 Minimum Number of Arrows to Burst Balloons
- s0456 132 pattern
- s0458 poor pigs
- s0459 repeated substring pattern
- s0460 lfu cache
- s0462 minimum moves to equal array elements ii
- s0463 island perimeter
- s0472 concatenated words
- s0473 matchsticks to square
- s0474 ones and zeroes
- s0491 non decreasing subsequences
- s0501 find mode in binary search tree
- s0502 IPO
- s0509 fibonacci number
- s0510 inorder successor in bst ii
- s0520 detect capital
- s0521 longest uncommon subsequence i
- s0523 continuous subarray sum
- s0540 single element in a sorted array
- s0542 01 matrix
- s0547 number of provinces
- s0557 reverse words in a string iii
- s0560 subarray sum equals k
- s0566 reshape the matrix
- s0567 permutation in string
- s0572 subtree of another tree
- s0576 out of boundary paths
- s0581 shortest unsorted continuous subarray
- s0583 delete operation for two strings
- s0605 can place flowers
- s0617 merge two binary trees
- s0622 design circular queue
- s0623 add one row to tree
- s0629 k inverse pairs array
- s0630 course schedule iii
- s0637 average of levels in binary tree
- s0645 set mismatch
- s0647 palindromic substrings
- s0652 find duplicate subtrees
- s0653 two sum iv - input is a bst
- s0665 non decreasing array
- s0668 kth smallest number in multiplication table
- s0682 baseball game
- s0692 top k frequent words
- s0695 max area of island
- s0700 search in a binary search tree
- s0701 insert into a binary search tree
- s0703 kth largest element in a stream
- s0704 binary search
- s0705 design hashset
- s0706 design hashmap
- s0707 design linked list
- s0713 subarray product less than k
- s0729 my calendar i
- s0733 flood fill
- s0740 delete and earn
- s0743 network delay time
- s0745 prefix and suffix search
- s0746 min cost climbing stairs
- s0763 partition labels
- s0766 toeplitz matrix
- s0767 reorganize string
- s0783 minimum distance between bst nodes
- s0784 letter case permutation
- s0787 cheapest flights within k stops
- s0792 number of matching subsequences
- s0797 all paths from source to target
- s0804 unique morse code words
- s0814 binary tree pruning
- s0820 short encoding of words
- s0823 binary trees with factors
- s0841 keys and rooms
- s0844 backspace string compare
- s0858 mirror reflection
- s0867 transpose matrix
- s0869 reordered power of 2
- s0875 koko eating bananas
- s0876 middle of the linked list
- s0890 find and replace pattern
- s0897 increasing order search tree
- s0899 orderly queue
- s0901 online stock span
- s0904 fruit into baskets
- s0905 sort array by parity
- s0907 sum of subarray minimums
- s0909 snakes and ladders
- s0912 sort an array
- s0916 word subsets
- s0918 maximum sum circular subarray
- s0926 flip string to monotone increasing
- s0942 di string match
- s0944 delete columns to make sorted
- s0946 validate stack sequences
- s0953 verifying an alien dictionary
- s0958 check completeness of a binary tree
- s0961 n-repeated element in size 2n array
- s0968 binary tree cameras
- s0973 k closest points to origin
- s0974 subarray sums divisible by k
- s0976 largest perimeter triangle
- s0977 squares of a sorted array
- s0981 time based key-value store
- s0983 minimum cost for tickets
- s0986 interval list intersections
- s0989 add to array-form of integer
- s0994 rotting oranges
- s0997 find the town judge
- s1011 capacity to ship packages within d days
- s1022 sum of root to leaf binary numbers
- s1046 last stone weight
- s1047 remove all adjacent duplicates in string
- s1048 longest string chain
- s1061 lexicographically smallest equivalent string
- s1071 greatest common divisor of strings
- s1074 number of submatrices that sum to target
- s1091 shortest path in binary matrix
- s1108 defanging an ip address
- s1129 shortest path with alternating colors
- s1137 n-th tribonacci number
- s1162 as far from land as possible
- s1182 shortest distance to target color
- s1192 critical connections in a network
- s1207 unique number of occurrences
- s1209 remove all adjacent duplicates in string ii
- s1220 count vowels permutation
- s1239 maximum length of a concatenated string with unique characters
- s1249 minimum remove to make valid parentheses
- s1268 search suggestions system
- s1302 deepest leaves sum
- s1319 number of operations to make network connected
- s1323 maximum 69 number
- s1328 break a palindrome
- s1329 sort the matrix diagonally
- s1331 rank transform of an array
- s1332 remove palindromic subsequences
- s1337 the k weakest rows in a matrix
- s1338 reduce array size to the half
- s1342 number of steps to reduce a number to zero
- s1345 jump game iv
- s1354 construct target array with multiple sums
- s1379 find a corresponding node of a binary tree in a clone of that tree
- s1394 find lucky integer in an array
- s1396 design underground system
- s1402 reducing dishes
- s1423 maximum points you can obtain from cards
- s1424 diagonal traverse ii
- s1441 build an array with stack operations
- s1443 minimum time to collect all apples in a tree
- s1448 count good nodes in binary tree
- s1461 check if a string contains all binary codes of size k
- s1465 maximum area of a piece of cake after horizontal and vertical cuts
- s1466 reorder routes to make all paths lead to the city zero
- s1470 shuffle the array
- s1472 design browser history
- s1480 running sum of 1d array
- s1481 least number of unique integers after k removals
- s1491 average salary excluding the minimum and maximum salary
- s1503 last moment before all ants fall out of a plank
- s1519 number of nodes in the sub-tree with the same label
- s1523 count odd numbers in an interval range
- s1535 find the winner of an array game
- s1539 kth missing positive number
- s1544 make the string great
- s1557 minimum number of vertices to reach all nodes
- s1561 maximum number of coins you can get
- s1598 crawler log folder
- s1614 maximum nesting depth of the parentheses
- s1626 best team with no conflicts
- s1630 arithmetic subarrays
- s1641 count sorted vowel strings
- s1642 furthest building you can reach
- s1647 minimum deletions to make character frequencies unique
- s1657 determine if two strings are close
- s1658 minimum operations to reduce x to zero
- s1662 check if two string arrays are equivalent
- s1672 richest customer wealth
- s1675 minimize deviation in array
- s1679 max number of k-sum pairs
- s1685 sum of absolute differences in a sorted array
- s1689 partitioning into minimum number of deci-binary numbers
- s1695 maximum erasure value
- s1696 jump game vi
- s1704 determine if string halves are alike
- s1706 where will the ball fall
- s1710 maximum units on a truck
- s1743 restore the array from adjacent pairs
- s1759 count number of homogenous substrings
- s1768 merge strings alternately
- s1814 count nice pairs in an array
- s1822 sign of the product of an array
- s1823 find the winner of the circular game
- s1832 check if the sentence is pangram
- s1833 maximum ice cream
- s1838 frequency of the most frequent element
- s1845 seat reservation manager
- s1876 substrings of size three with distinct characters
- s1877 minimize maximum pair sum in array
- s1921 eliminate maximum number of monsters
- s1926 nearest exit from entrance in maze
- s1980 find unique binary string
- s2095 delete the middle node of a linked list
- s2114 maximum number of words found in sentences
- s2124 check if all as appears before all bs
- s2131 longest palindrome by concatenating two letter words
- s2133 check if every row and column contains all numbers
- s2154 keep multiplying found values by two
- s2187 minimum time to complete trips
- s2215 find the difference of two arrays
- s2225 find players with zero or one losses
- s2244 minimum rounds to complete all tasks
- s2246 longest path with different adjacent characters
- s2256 minimum average difference
- s2265 count nodes equal to average of subtree
- s2279 Maximum Bags With Full Capacity of Rocks
- s2293 min max game
- s2306 naming a company
- s2316 count unreachable pairs of nodes in an undirected graph
- s2336 smallest number in infinite set
- s2348 number of zero-filled subarrays
- s2359 find closest node to given two nodes
- s2360 longest cycle in a graph
- s2389 longest subsequence with limited sum
- s2390 removing stars from a string
- s2391 minimum amount of time to collect garbage
- s2405 optimal partition of string
- s2421 number of good paths
- s2433 find the original array of prefix xor
- s2439 minimize maximum of array
- s2444 count subarrays with fixed bounds
- s2477 minimum fuel cost to report to the capital
- s2492 minimum score of a path between two cities
- s2849 determine if a cell is reachable at a given time
Click to show internal directories.
Click to hide internal directories.