README ¶ leetcode-go My LeetCode solutions primarily written in Go. Don't expect too much on those questions solved in other random languages. README Generator Usage Copy the cookies from your browser and write them into a cookies.json file, { "__cfduid": "", "_ga": "", "LEETCODE_SESSION": "", "_gid": "", "__stripe_mid": "", "c_a_u": "" } Run readme-generator.py. Here you ≡Go! My progress Solved Easy Medium Hard 166 90 67 9 Solutions Question ID Question Difficulty Solution 1 Two Sum Easy Go 2 Add Two Numbers Medium Go 3 Longest Substring Without Repeating Characters Medium Go 4 Median of Two Sorted Arrays Hard Go 5 Longest Palindromic Substring Medium Go 7 Reverse Integer Easy Go 9 Palindrome Number Easy Go 11 Container With Most Water Medium Go 12 Integer to Roman Medium Go 13 Roman to Integer Easy Go 14 Longest Common Prefix Easy Go 15 3Sum Medium Go 17 Letter Combinations of a Phone Number Medium Go 19 Remove Nth Node From End of List Medium Go, Python 20 Valid Parentheses Easy Go 21 Merge Two Sorted Lists Easy Go 22 Generate Parentheses Medium Go 23 Merge k Sorted Lists Hard Go, Java 24 Swap Nodes in Pairs Medium Go 26 Remove Duplicates from Sorted Array Easy Go 27 Remove Element Easy Go 28 Implement strStr() Easy Go 31 Next Permutation Medium Go 33 Search in Rotated Sorted Array Medium Go 34 Find First and Last Position of Element in Sorted Array Medium Go 35 Search Insert Position Easy Go 36 Valid Sudoku Medium Go 37 Sudoku Solver Hard Go 38 Count and Say Easy Go 39 Combination Sum Medium Go 40 Combination Sum II Medium Go 43 Multiply Strings Medium Go 46 Permutations Medium Go 48 Rotate Image Medium Go 49 Group Anagrams Medium Go 50 Pow(x, n) Medium Go 51 N-Queens Hard Go 52 N-Queens II Hard Go 53 Maximum Subarray Easy Go 55 Jump Game Medium Go 62 Unique Paths Medium Go 64 Minimum Path Sum Medium Go 66 Plus One Easy Go 67 Add Binary Easy Go 69 Sqrt(x) Easy Go 70 Climbing Stairs Easy Go 72 Edit Distance Hard Go 73 Set Matrix Zeroes Medium Go 74 Search a 2D Matrix Medium Go, Python 78 Subsets Medium Go 79 Word Search Medium Go 88 Merge Sorted Array Easy Go 91 Decode Ways Medium Go 94 Binary Tree Inorder Traversal Medium Go 98 Validate Binary Search Tree Medium Go 100 Same Tree Easy Go 101 Symmetric Tree Easy Go 102 Binary Tree Level Order Traversal Medium Go 104 Maximum Depth of Binary Tree Easy Go 108 Convert Sorted Array to Binary Search Tree Easy Go 109 Convert Sorted List to Binary Search Tree Medium Go 110 Balanced Binary Tree Easy Go 112 Path Sum Easy Go 113 Path Sum II Medium Go 114 Flatten Binary Tree to Linked List Medium Go 118 Pascal's Triangle Easy Go 119 Pascal's Triangle II Easy Go 121 Best Time to Buy and Sell Stock Easy Go 122 Best Time to Buy and Sell Stock II Easy Go 125 Valid Palindrome Easy Go 133 Clone Graph Medium C++ 136 Single Number Easy Go 137 Single Number II Medium Go 144 Binary Tree Preorder Traversal Medium Go 145 Binary Tree Postorder Traversal Hard Go 146 LRU Cache Medium Go 153 Find Minimum in Rotated Sorted Array Medium Go 154 Find Minimum in Rotated Sorted Array II Hard Go 160 Intersection of Two Linked Lists Easy Go 162 Find Peak Element Medium Go 167 Two Sum II - Input array is sorted Easy Go 169 Majority Element Easy Go 173 Binary Search Tree Iterator Medium Go 187 Repeated DNA Sequences Medium Go 189 Rotate Array Easy Go 198 House Robber Easy Go 199 Binary Tree Right Side View Medium Go 200 Number of Islands Medium Go 202 Happy Number Easy Go 204 Count Primes Easy Go 205 Isomorphic Strings Easy Go 206 Reverse Linked List Easy Go 215 Kth Largest Element in an Array Medium Go 217 Contains Duplicate Easy Go 219 Contains Duplicate II Easy Go 226 Invert Binary Tree Easy , Go 230 Kth Smallest Element in a BST Medium Go 231 Power of Two Easy Go 232 Implement Queue using Stacks Easy Go 235 Lowest Common Ancestor of a Binary Search Tree Easy Go 237 Delete Node in a Linked List Easy Go 242 Valid Anagram Easy Go 257 Binary Tree Paths Easy Go 263 Ugly Number Easy Go 268 Missing Number Easy Go 278 First Bad Version Easy Java 279 Perfect Squares Medium Go 283 Move Zeroes Easy Go 287 Find the Duplicate Number Medium Go 303 Range Sum Query - Immutable Easy Go 322 Coin Change Medium Go 326 Power of Three Easy Go 328 Odd Even Linked List Medium Go 344 Reverse String Easy Go 345 Reverse Vowels of a String Easy Go 347 Top K Frequent Elements Medium Go 349 Intersection of Two Arrays Easy Go 350 Intersection of Two Arrays II Easy Go 367 Valid Perfect Square Easy Go 374 Guess Number Higher or Lower Easy Java 387 First Unique Character in a String Easy Go 389 Find the Difference Easy Go 403 Frog Jump Hard Go 404 Sum of Left Leaves Easy Go 409 Longest Palindrome Easy Go 412 Fizz Buzz Easy Go 416 Partition Equal Subset Sum Medium Go 419 Battleships in a Board Medium Go 448 Find All Numbers Disappeared in an Array Easy Go 451 Sort Characters By Frequency Medium Go 461 Hamming Distance Easy Go 476 Number Complement Easy Go 482 License Key Formatting Easy Go 520 Detect Capital Easy Go 538 Convert BST to Greater Tree Easy Go 617 Merge Two Binary Trees Easy Go 621 Task Scheduler Medium Go 657 Robot Return to Origin Easy Go 658 Find K Closest Elements Medium Go 680 Valid Palindrome II Easy Go 693 Binary Number with Alternating Bits Easy Go 695 Max Area of Island Medium Go 733 Flood Fill Easy Go 745 Find Smallest Letter Greater Than Target Easy Go 768 Partition Labels Medium Go 782 Jewels and Stones Easy Go 792 Binary Search Easy Go 822 Unique Morse Code Words Easy Go 837 Most Common Word Easy Go 860 Design Circular Queue Medium Go 861 Flipping an Image Easy Go 871 Keys and Rooms Medium Go 874 Backspace String Compare Easy Go 917 Boats to Save People Medium Go 926 Find and Replace Pattern Medium Go 932 Monotonic Array Easy Go 940 Fruit Into Baskets Medium Go 941 Sort Array By Parity Easy Go 965 Unique Email Addresses Easy Go 975 Range Sum of BST Easy Go 978 Valid Mountain Array Easy Go 1013 Fibonacci Number Easy Go 1014 K Closest Points to Origin Medium Go 1078 Remove Outermost Parentheses Easy Go 1207 Delete Nodes And Return Forest Medium Go 1369 Minimum Swaps to Make Strings Equal Medium Go Expand ▾ Collapse ▴ Directories ¶ Show internal Expand all Path Synopsis src 3sum command add-binary command add-two-numbers command backspace-string-compare command balanced-binary-tree command battleships-in-a-board command best-time-to-buy-and-sell-stock command best-time-to-buy-and-sell-stock-ii command binary-number-with-alternating-bits command binary-search command binary-search-tree-iterator command binary-tree-inorder-traversal command binary-tree-level-order-traversal command binary-tree-paths command binary-tree-postorder-traversal command binary-tree-preorder-traversal command binary-tree-right-side-view command boats-to-save-people command climbing-stairs command coin-change command combination-sum command combination-sum-ii command container-with-most-water command contains-duplicate command contains-duplicate-ii command convert-bst-to-greater-tree command convert-sorted-array-to-binary-search-tree command convert-sorted-list-to-binary-search-tree command count-and-say command count-primes command decode-ways command delete-node-in-a-linked-list command delete-nodes-and-return-forest command design-circular-queue command detect-capital command edit-distance command fibonacci-number command find-all-numbers-disappeared-in-an-array command find-and-replace-pattern command find-first-and-last-position-of-element-in-sorted-array command find-k-closest-elements command find-minimum-in-rotated-sorted-array command find-minimum-in-rotated-sorted-array-ii command find-peak-element command find-smallest-letter-greater-than-target command find-the-difference command find-the-duplicate-number command first-unique-character-in-a-string command fizz-buzz command flatten-binary-tree-to-linked-list command flipping-an-image command flood-fill command frog-jump command fruit-into-baskets command generate-parentheses command group-anagrams command hamming-distance command happy-number command house-robber command implement-queue-using-stacks command implement-strstr command integer-to-roman command intersection-of-two-arrays command intersection-of-two-arrays-ii command intersection-of-two-linked-lists command invert-binary-tree command isomorphic-strings command jewels-and-stones command jump-game command k-closest-points-to-origin command keys-and-rooms command kth-largest-element-in-an-array command kth-smallest-element-in-a-bst command letter-combinations-of-a-phone-number command license-key-formatting command longest-common-prefix command longest-palindrome command longest-palindromic-substring command longest-substring-without-repeating-characters command lowest-common-ancestor-of-a-binary-search-tree command lru-cache command majority-element command max-area-of-island command maximum-depth-of-binary-tree command maximum-subarray command median-of-two-sorted-arrays command merge-k-sorted-lists command merge-sorted-array command merge-two-binary-trees command merge-two-sorted-lists command minimum-path-sum command minimum-swaps-to-make-strings-equal command missing-number command monotonic-array command most-common-word command move-zeroes command multiply-strings command n-queens command n-queens-ii command next-permutation command number-complement command number-of-islands command odd-even-linked-list command palindrome-number command partition-equal-subset-sum command partition-labels command pascals-triangle command pascals-triangle-ii command path-sum command path-sum-ii command perfect-squares command permutations command plus-one command power-of-three command power-of-two command powx-n command range-sum-of-bst command range-sum-query-immutable command remove-duplicates-from-sorted-array command remove-element command remove-nth-node-from-end-of-list command remove-outermost-parentheses command repeated-dna-sequences command reverse-integer command reverse-linked-list command reverse-string command reverse-vowels-of-a-string command robot-return-to-origin command roman-to-integer command rotate-array command rotate-image command same-tree command search-a-2d-matrix command search-in-rotated-sorted-array command search-insert-position command set-matrix-zeroes command single-number command single-number-ii command sort-array-by-parity command sort-characters-by-frequency command sqrtx command subsets command sudoku-solver command sum-of-left-leaves command swap-nodes-in-pairs command symmetric-tree command task-scheduler command top-k-frequent-elements command two-sum command two-sum-ii-input-array-is-sorted command ugly-number command unique-email-addresses command unique-morse-code-words command unique-paths command valid-anagram command valid-mountain-array command valid-palindrome command valid-palindrome-ii command valid-parentheses command valid-perfect-square command valid-sudoku command validate-binary-search-tree command word-search command Click to show internal directories. Click to hide internal directories.