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 add-binary add-two-numbers backspace-string-compare balanced-binary-tree battleships-in-a-board best-time-to-buy-and-sell-stock best-time-to-buy-and-sell-stock-ii binary-number-with-alternating-bits binary-search binary-search-tree-iterator binary-tree-inorder-traversal binary-tree-level-order-traversal binary-tree-paths binary-tree-postorder-traversal binary-tree-preorder-traversal binary-tree-right-side-view boats-to-save-people climbing-stairs coin-change combination-sum combination-sum-ii container-with-most-water contains-duplicate contains-duplicate-ii convert-bst-to-greater-tree convert-sorted-array-to-binary-search-tree convert-sorted-list-to-binary-search-tree count-and-say count-primes decode-ways delete-node-in-a-linked-list delete-nodes-and-return-forest design-circular-queue detect-capital edit-distance fibonacci-number find-all-numbers-disappeared-in-an-array find-and-replace-pattern find-first-and-last-position-of-element-in-sorted-array find-k-closest-elements find-minimum-in-rotated-sorted-array find-minimum-in-rotated-sorted-array-ii find-peak-element find-smallest-letter-greater-than-target find-the-difference find-the-duplicate-number first-unique-character-in-a-string fizz-buzz flatten-binary-tree-to-linked-list flipping-an-image flood-fill frog-jump fruit-into-baskets generate-parentheses group-anagrams hamming-distance happy-number house-robber implement-queue-using-stacks implement-strstr integer-to-roman intersection-of-two-arrays intersection-of-two-arrays-ii intersection-of-two-linked-lists invert-binary-tree isomorphic-strings jewels-and-stones jump-game k-closest-points-to-origin keys-and-rooms kth-largest-element-in-an-array kth-smallest-element-in-a-bst letter-combinations-of-a-phone-number license-key-formatting longest-common-prefix longest-palindrome longest-palindromic-substring longest-substring-without-repeating-characters lowest-common-ancestor-of-a-binary-search-tree lru-cache majority-element max-area-of-island maximum-depth-of-binary-tree maximum-subarray median-of-two-sorted-arrays merge-k-sorted-lists merge-sorted-array merge-two-binary-trees merge-two-sorted-lists minimum-path-sum minimum-swaps-to-make-strings-equal missing-number monotonic-array most-common-word move-zeroes multiply-strings n-queens n-queens-ii next-permutation number-complement number-of-islands odd-even-linked-list palindrome-number partition-equal-subset-sum partition-labels pascals-triangle pascals-triangle-ii path-sum path-sum-ii perfect-squares permutations plus-one power-of-three power-of-two powx-n range-sum-of-bst range-sum-query-immutable remove-duplicates-from-sorted-array remove-element remove-nth-node-from-end-of-list remove-outermost-parentheses repeated-dna-sequences reverse-integer reverse-linked-list reverse-string reverse-vowels-of-a-string robot-return-to-origin roman-to-integer rotate-array rotate-image same-tree search-a-2d-matrix search-in-rotated-sorted-array search-insert-position set-matrix-zeroes single-number single-number-ii sort-array-by-parity sort-characters-by-frequency sqrtx subsets sudoku-solver sum-of-left-leaves swap-nodes-in-pairs symmetric-tree task-scheduler top-k-frequent-elements two-sum two-sum-ii-input-array-is-sorted ugly-number unique-email-addresses unique-morse-code-words unique-paths valid-anagram valid-mountain-array valid-palindrome valid-palindrome-ii valid-parentheses valid-perfect-square valid-sudoku validate-binary-search-tree word-search Click to show internal directories. Click to hide internal directories.