Popularity
9.2
Growing
Activity
8.5
Growing
3,123
128
481

Code Quality Rank: L4
Programming language: Swift

LeetCode_Swift alternatives and similar libraries

Based on the "Data Structures" category

Do you think we are missing an alternative of LeetCode_Swift or a related project?

Add another 'Data Structures' Library

README

LeetCode by Swift

LeetCode Online Judge is a website containing many algorithm questions. Most of them are real interview questions of Google, Facebook, LinkedIn, Apple, etc. This repo shows my solutions by Swift with the code style strictly follows the RayWenderlich Swift Style Guide. Please feel free to reference and STAR to support this repo, thank you!

[Leetcode](./logo.png?style=centerme)

Progress

Problem Status shows the latest progress to all 1000+ questions. Currently we have 292 completed solutions. Note: questions with ♥ mark means that you have to Subscript to premium membership of LeetCode to unlock them.

Contributors

Data Structures

Companies

Array

Title Solution Difficulty Time Space
Sort Array By Parity [Swift](Array/SortArrayByParity.swift) Easy O(n) O(n)
Max Consecutive Ones [Swift](./Array/MaxConsecutiveOnes.swift) Easy O(n) O(1)
Heaters [Swift](./Array/Heaters.swift) Easy O(nlogn) O(1)
Number of Boomerangs [Swift](./Array/NumberBoomerangs.swift) Easy O(n ^ 2) O(n)
Island Perimeter [Swift](./Array/IslandPerimeter.swift) Easy O(nm) O(1)
Majority Element [Swift](./Array/MajorityElement.swift) Easy O(n) O(1)
Majority Element II [Swift](./Array/MajorityElementII.swift) Medium O(n) O(1)
First Missing Positive [Swift](./Array/FirstMissingPositive.swift) Hard O(n) O(n)
Intersection of Two Arrays [Swift](./Array/IntersectionTwoArrays.swift) Easy O(n) O(n)
Intersection of Two Arrays II [Swift](./Array/IntersectionTwoArraysII.swift) Easy O(n) O(n)
Contains Duplicate [Swift](./Array/ContainsDuplicate.swift) Easy O(n) O(n)
Contains Duplicate II [Swift](./Array/ContainsDuplicateII.swift) Easy O(n) O(n)
Remove Duplicates from Sorted Array [Swift](./Array/RemoveDuplicatesFromSortedArray.swift) Easy O(n) O(1)
Remove Duplicates from Sorted Array II [Swift](./Array/RemoveDuplicatesFromSortedArrayII.swift) Medium O(n) O(1)
Move Zeroes [Swift](./Array/MoveZeroes.swift) Easy O(n) O(1)
Remove Element [Swift](./Array/RemoveElement.swift) Easy O(n) O(1)
Strobogrammatic Number [Swift](./Array/StrobogrammaticNumber.swift) Easy O(n) O(1)
Two Sum [Swift](./Array/TwoSum.swift) Easy O(n) O(n)
Two Sum Less Than K [Swift](./Array/TwoSumLessThanK.swift) Easy O(nlogn) O(n)
3Sum [Swift](./Array/ThreeSum.swift) Medium O(n2) O(nC3)
3Sum Closest [Swift](./Array/ThreeSumClosest.swift) Medium O(n2) O(nC3)
4Sum [Swift](./Array/FourSum.swift) Medium O(n3) O(nC4)
Increasing Triplet Subsequence [Swift](./Array/IncreasingTripletSubsequence.swift) Medium O(n) O(1)
Summary Ranges [Swift](./Array/SummaryRanges.swift) Medium O(n) O(n)
Range Sum Query 2D - Immutable [Swift](./Array/NumMatrix.swift) Medium O(mn) O(mn)
Missing Ranges [Swift](./Array/MissingRanges.swift) Medium O(n) O(1)
Asteroid Collision [Swift](./Array/AsteroidCollision.swift) Medium O(n) O(n)
Maximize Distance to Closest Person [Swift](./Array/MaximizeDistanceToClosestPerson.swift) Easy O(n) O(1)
Exam Room [Swift](./Array/ExamRoom.swift) Medium O(n) O(n)
Shortest Word Distance [Swift](./Array/ShortestWordDistance.swift) Easy O(n) O(1)
Shortest Word Distance III [Swift](./Array/ShortestWordDistanceIII.swift) Medium O(n) O(1)
Minimum Size Subarray Sum [Swift](./Array/MinimumSizeSubarraySum.swift) Medium O(n) O(1)
Maximum Size Subarray Sum Equals k [Swift](./Array/MaximumSizeSubarraySumEqualsK.swift) Medium O(n) O(n)
Smallest Range [Swift](./Array/SmallestRange.swift) Hard O(nm) O(nm)
Product of Array Except Self [Swift](./Array/ProductExceptSelf.swift) Medium O(n) O(1)
Rotate Array [Swift](./Array/RotateArray.swift) Easy O(n) O(1)
Rotate Image [Swift](./Array/RotateImage.swift) Medium O(n2) O(1)
Spiral Matrix [Swift](./Array/SpiralMatrix.swift) Medium O(n2) O(1)
Spiral Matrix II [Swift](./Array/SpiralMatrixII.swift) Medium O(n2) O(1)
Diagonal Traverse [Swift](./Array/DiagonalTraverse.swift) Medium O(mn) O(1)
Valid Sudoku [Swift](./Array/ValidSudoku.swift) Easy O(n2) O(n)
Set Matrix Zero [Swift](./Array/SetMatrixZeroes.swift) Medium O(n2) O(1)
Next Permutation [Swift](./Array/NextPermutation.swift) Medium O(n) O(1)
Gas Station [Swift](./Array/GasStation.swift) Medium O(n) O(1)
Game of Life [Swift](./Array/GameLife.swift) Medium O(n) O(1)
Task Scheduler [Swift](./Array/TaskScheduler.swift) Medium O(nlogn) O(n)
Sliding Window Maximum [Swift](./Array/SlidingWindowMaximum.swift) Hard O(n) O(n)
Longest Consecutive Sequence [Swift](./Array/LongestConsecutiveSequence.swift) Hard O(n) O(n)
Create Maximum Number [Swift](./Array/CreateMaximumNumber.swift) Hard O(n2) O(n)
Find All Numbers Disappeared in an Array [Swift](./Array/FindDisappearedNumbers.swift) Easy O(n) O(1)

String

Title Solution Difficulty Time Space
Fizz Buzz [Swift](./String/FizzBuzz.swift) Easy O(n) O(1)
First Unique Character in a String [Swift](./String/FirstUniqueCharacterInString.swift) Easy O(n) O(1)
Keyboard Row [Swift](./String/KeyboardRow.swift) Easy O(nm) O(n)
Valid Palindrome [Swift](./String/ValidPalindrome.swift) Easy O(n) O(n)
Valid Palindrome II [Swift](./String/ValidPalindromeII.swift) Easy O(n) O(n)
Detect Capital [Swift](./String/DetectCapital.swift) Easy O(n) O(1)
Count and Say [Swift](./String/CountAndSay.swift) Easy O(n2) O(1)
Flip Game [Swift](./String/FlipGame.swift) Easy O(n) O(n)
Implement strStr() [Swift](./String/StrStr.swift) Easy O(nm) O(n)
Isomorphic Strings [Swift](./String/IsomorphicStrings.swift) Easy O(n) O(n)
Reverse String [Swift](./String/ReverseString.swift) Easy O(n) O(n)
Reverse String II [Swift](./String/ReverseStringII.swift) Easy O(n) O(n)
Reverse Vowels of a String [Swift](./String/ReverseVowelsOfAString.swift) Easy O(n) O(n)
Reverse Words in a String [Swift](./String/ReverseWordsString.swift) Medium O(n) O(1)
Reverse Words in a String II [Swift](./String/ReverseWordsStringII.swift) Medium O(n) O(1)
Reverse Words in a String III [Swift](./String/ReverseWordsStringIII.swift) Easy O(n) O(1)
Length of Last Word [Swift](./String/AddStrings.swift) Easy O(n) O(n)
String Compression [Swift](./String/StringCompression.swift) Easy O(n) O(1)
Add Strings [Swift](./String/LengthLastWord.swift) Easy O(n) O(1)
Shortest Distance to a Character [Swift](./String/ShortestDistanceToACharacter.swift) Easy O(n) O(1)
Multiply Strings [Swift](./String/MultiplyStrings.swift) Medium O(n) O(1)
Palindrome Permutation [Swift](./String/PalindromePermutation.swift) Easy O(n) O(n)
Valid Anagram [Swift](./String/ValidAnagram.swift) Easy O(n) O(n)
Ransom Note [Swift](./String/RansomNote.swift) Easy O(n) O(n)
Group Anagrams [Swift](./String/GroupAnagrams.swift) Medium O(nmlogm + nlogn) O(n)
Find Duplicate File in System [Swift](./String/FindDuplicateFileInSystem.swift) Medium O(nm) O(n)
Longest Common Prefix [Swift](./String/LongestCommonPrefix.swift) Easy O(nm) O(m)
Longest Substring Without Repeating Characters [Swift](./String/LongestSubstringWithoutRepeatingCharacters.swift) Medium O(n) O(n)
One Edit Distance [Swift](./String/OneEditDistance.swift) Medium O(n) O(n)
Word Pattern [Swift](./String/WordPattern.swift) Easy O(n) O(n)
Minimum Window Substring [Swift](./Array/MinimumWindowSubstring.swift) Hard O(n2) O(n)
Longest Substring with At Most Two Distinct Characters [Swift](./String/LongestSubstringMostTwoDistinctCharacters.swift) Hard O(n) O(n)
Longest Substring with At Most K Distinct Characters [Swift](./String/LongestSubstringMostKDistinctCharacters.swift) Hard O(n) O(n)
Text Justification [Swift](./String/TextJustification.swift) Hard O(n) O(n)

Linked List

Title Solution Difficulty Time Space
Reverse Linked List [Swift](./LinkedList/ReverseLinkedList.swift) Easy O(n) O(1)
Palindrome Linked List [Swift](./LinkedList/PalindromeLinkedList.swift) Easy O(n) O(1)
Swap Nodes in Pairs [Swift](./LinkedList/SwapNodesInPairs.swift) Easy O(n) O(1)
Remove Linked List Elements [Swift](./LinkedList/RemoveLinkedListElements.swift) Easy O(n) O(1)
Remove Duplicates from Sorted List [Swift](./LinkedList/RemoveDuplicatesFromSortedList.swift) Easy O(n) O(1)
Remove Duplicates from Sorted List II [Swift](./LinkedList/RemoveDuplicatesFromSortedListII.swift) Medium O(n) O(1)
Remove Nth Node From End of List [Swift](./LinkedList/RemoveNthFromEnd.swift) Easy O(n) O(1)
Odd Even Linked List [Swift](./LinkedList/OddEvenLinkedList.swift) Medium O(n) O(1)
Rotate List [Swift](./LinkedList/RotateList.swift) Medium O(n) O(1)
Reorder List [Swift](./LinkedList/ReorderList.swift) Medium O(n) O(1)
Merge Two Sorted Lists [Swift](./LinkedList/MergeTwoSortedLists.swift) Easy O(n) O(1)
Merge k Sorted Lists [Swift](./LinkedList/MergeKSortedLists.swift) Hard O(mlogn) O(1)
Partition List [Swift](./LinkedList/PartitionList.swift) Medium O(n) O(1)
LRU Cache [Swift](./LinkedList/LRUCache.swift) Hard O(1) O(1)
LFU Cache [Swift](./LinkedList/LFUCache.swift) Hard O(1) O(1)

Stack

Title Solution Difficulty Time Space
Min Stack [Swift](./Stack/MinStack.swift) Easy O(1) O(n)
Valid Parentheses [Swift](./Stack/ValidParentheses.swift) Easy O(n) O(n)
Longest Valid Parentheses [Swift](./Stack/LongestValidParentheses.swift) Hard O(n) O(n)
Evaluate Reverse Polish Notation [Swift](./Stack/EvaluateReversePolishNotation.swift) Medium O(n) O(n)
Simplify Path [Swift](./Stack/SimplifyPath.swift) Medium O(n) O(n)
Remove K Digits [Swift](./Stack/RemoveKDigits.swift) Medium O(n) O(n)
Ternary Expression Parser [Swift](./Stack/TernaryExpressionParser.swift) Medium O(n) O(n)
Binary Tree Preorder Traversal [Swift](./Stack/PreorderTraversal.swift) Medium O(n) O(n)
Binary Tree Inorder Traversal [Swift](./Stack/InorderTraversal.swift) Medium O(n) O(n)
Binary Tree Postorder Traversal [Swift](./Stack/PostorderTraversal.swift) Hard O(n) O(n)
Decode String [Swift](./Stack/DecodeString.swift) Medium O(n) O(n)

Queue

Title Solution Difficulty Time Space
Implement Queue using Stacks [Swift](./Queue/ImplementQueueUsingStacks.swift) Easy O(n) O(n)

Tree

Title Solution Difficulty Time Space
Same Tree [Swift](./Tree/SameTree.swift) Easy O(n) O(n)
Symmetric Tree [Swift](./Tree/SymmetricTree.swift) Easy O(n) O(n)
Invert Binary Tree [Swift](./Tree/InvertBinaryTree) Easy O(n) O(n)
Binary Tree Upside Down [Swift](./Tree/BinaryTreeUpsideDown) Medium O(n) O(1)
Minimum Depth of Binary Tree [Swift](./Tree/MinimumDepthOfBinaryTree.swift) Easy O(n) O(1)
Maximum Depth of Binary Tree [Swift](./Tree/MaximumDepthOfBinaryTree.swift) Easy O(n) O(1)
Diameter of Binary Tree [Swift](./Tree/DiameterBinaryTree.swift) Easy O(n) O(1)
Balanced Binary Tree [Swift](./Tree/BalancedBinaryTree.swift) Easy O(n) O(n)
Sum of Left Leaves [Swift](./Tree/SumLeftLeaves.swift) Easy O(n) O(1)
Flatten Binary Tree to Linked List [Swift](./Tree/FlattenBinaryTreeLinkedList.swift) Medium O(n) O(1)
Convert Sorted Array to Binary Search Tree [Swift](./Tree/ConvertSortedArrayBinarySearchTree.swift) Easy O(n) O(1)
Validate Binary Search Tree [Swift](./Tree/ValidateBinarySearchTree.swift) Medium O(n) O(log n)
Binary Tree Level Order Traversal [Swift](./Tree/BinaryTreeLevelOrderTraversal.swift) Easy O(n) O(n)
Binary Tree Level Order Traversal II [Swift](./Tree/BinaryTreeLevelOrderTraversalII.swift) Easy O(n) O(n)
Binary Tree Zigzag Level Order Traversal [Swift](./Tree/BinaryTreeZigzagLevelOrderTraversal.swift) Medium O(n) O(n)
Binary Tree Vertical Order Traversal [Swift](./Tree/BinaryTreeVerticalOrderTraversal.swift) Medium O(n) O(n)
Kth Smallest Element in a BST [Swift](./Tree/KthSmallestElementBST.swift) Medium O(n) O(n)
Binary Tree Right Side View [Swift](./Tree/BinaryTreeRightSideView.swift) Medium O(n) O(n)
Construct Binary Tree from Preorder and Inorder Traversal [Swift](./Tree/ConstructBinaryTreePreorderInorder.swift) Medium O(nlogn) O(1)
Construct Binary Tree from Inorder and Postorder Traversal [Swift](./Tree/ConstructBinaryTreeInorderPostorder.swift) Medium O(nlogn) O(1)
Path Sum [Swift](./Tree/PathSum.swift) Easy O(n) O(n)
Path Sum II [Swift](./Tree/PathSumII.swift) Medium O(n) O(n)
Path Sum III [Swift](./Tree/PathSumIII.swift) Easy O(n2) O(1)
Bnary Tree Paths [Swift](./Tree/BnaryTreePaths.swift) Easy O(n) O(n)
House Robber III [Swift](./Tree/HouseRobberIII.swift) Medium O(n) O(1)
Unique Binary Search Trees [Swift](./Tree/UniqueBinarySearchTrees.swift) Medium O(n2) O(n)
Recover Binary Search Tree [Swift](./Tree/RecoverBinarySearchTree.swift) Hard O(n) O(1)
Merge Two Binary Trees [Swift](./Tree/MergeTwoBinaryTrees.swift) Easy O(n) O(n)

Dynamic programming

Title Solution Difficulty Time Space
Nested List Weight Sum [Swift](./DP/NestedListWeightSum.swift) Easy O(n) O(1)
Climbing Stairs [Swift](./DP/ClimbingStairs.swift) Easy O(n) O(1)
Min Cost Climbing Stairs [Swift](./DP/MinCostClimbingStairs.swift) Easy O(n) O(n)
Unique Paths [Swift](./DP/UniquePaths.swift) Medium O(mn) O(mn)
Unique Paths II [Swift](./DP/UniquePathsII.swift) Medium O(mn) O(mn)
Flip Game II [Swift](./DP/FlipGameII.swift) Medium O(n) O(n)
Can I Win [Swift](./DP/CanIWin.swift) Medium O(2n) O(n)
Decode Ways [Swift](./DP/DecodeWays.swift) O(n) O(n)
Minimum Path Sum [Swift](./DP/MinimumPathSum.swift) Medium O(mn) O(mn)
Generate Parentheses [Swift](./DP/GenerateParentheses.swift) Medium O(2n) O(n)
Different Ways to Add Parentheses [Swift](./DP/DifferentWaysAddParentheses.swift) Medium O(nn) O(n)
Best Time to Buy and Sell Stock [Swift](./DP/BestTimeBuySellStock.swift) Easy O(n) O(1)
Best Time to Buy and Sell Stock II [Swift](./DP/BestTimeBuySellStockII.swift) Medium O(n) O(1)
Best Time to Buy and Sell Stock III [Swift](./DP/BestTimeBuySellStockIII.swift) Hard O(n) O(n)
Best Time to Buy and Sell Stock IV [Swift](./DP/BestTimeBuySellStockIV.swift) Hard O(n2) O(n)
Best Time to Buy and Sell Stock with Cooldown [Swift](./DP/BestTimeBuySellStockCooldown.swift) Medium O(n2) O(n)
Maximum Sum of 3 Non-Overlapping Subarrays [Swift](./DP/MaximumSumThreeNonOverlappingSubarrays.swift) Hard O(n) O(n)
Coin Change [Swift](./DP/CoinChange.swift) Medium O(n2) O(n)
Coin Change II [Swift](./DP/CoinChangeII.swift) Medium O(n2) O(n)
Longest Increasing Subsequence [Swift](./DP/LongestIncreasingSubsequence.swift) Medium O(nlogn) O(n)
Palindromic Substrings [Swift](./DP/PalindromicSubstrings.swift) Medium O(n2) O(n2)
Longest Palindromic Substring [Swift](./DP/LongestPalindromicSubstring.swift) Medium O(n2) O(n2)
Perfect Squares [Swift](./DP/PerfectSquares.swift) Medium O(n2) O(n)
House Robber [Swift](./DP/HouseRobber.swift) Easy O(n) O(1)
House Robber II [Swift](./DP/HouseRobberII.swift) Medium O(n) O(1)
Paint Fence [Swift](./DP/PaintFence.swift) Easy O(n) O(n)
Maximum Subarray [Swift](./DP/MaximumSubarray.swift) Medium O(n) O(1)
Maximum Product Subarray [Swift](./DP/MaximumProductSubarray.swift) Medium O(n) O(1)
Maximal Square [Swift](./DP/MaximalSquare.swift) Medium O(mn) O(mn)
Edit Distance [Swift](./DP/EditDistance.swift) Hard O(mn) O(mn)
Combination Sum IV [Swift](./DP/CombinationSumIV.swift) Medium O(2n) O(n)
Triangle [Swift](./DP/Triangle.swift) Medium O(2n) O(m)
Wiggle Subsequence [Swift](./DP/WiggleSubsequence.swift) Medium O(n) O(1)
Wildcard Matching [Swift](./DP/WildcardMatching.swift) Hard O(mn) O(mn)
Regular Expression Matching [Swift](./DP/RegularExpressionMatching.swift) Hard O(mn) O(mn)
Minimum Window Subsequence [Swift](./DP/MinimumWindowSubsequence.swift) Hard O(mn) O(mn)
Guess Number Higher or Lower II [Swift](./DP/GuessNumberHigherOrLowerII.swift) Medium O(nlogn) O(n2)
Burst Ballons [Swift](./DP/BurstBalloons.swift) Hard O(n3) O(n)
Frog Jump [Swift](./DP/FrogJump.swift) Hard O(n2) O(n)
Jump Game [Swift](./DP/JumpGame.swift) Medium O(n) O(1)
Dungeon Game [Swift](./DP/DungeonGame.swift) Hard O(nm) O(nm)
Title Solution Difficulty Time Space
Permutations [Swift](./DFS/Permutations.swift) Medium O(nn) O(n)
Permutations II [Swift](./DFS/PermutationsII.swift) Medium O(nn) O(n)
Subsets [Swift](./DFS/Subsets.swift) Medium O(nn) O(n)
Subsets II [Swift](./DFS/SubsetsII.swift) Medium O(nn) O(n)
Combinations [Swift](./DFS/Combinations.swift) Medium O(nn) O(n)
Combination Sum [Swift](./DFS/CombinationSum.swift) Medium O(nn) O(2n - 1)
Combination Sum II [Swift](./DFS/CombinationSumII.swift) Medium O(nn) O(2n - 2)
Combination Sum III [Swift](./DFS/CombinationSumIII.swift) Medium O(nn) O(nCk)
Letter Combinations of a Phone Number [Swift](./DFS/LetterCombinationsPhoneNumber.swift) Medium O(4n) O(n)
Factor Combinations [Swift](./DFS/FactorCombinations.swift) Medium O(nn)) O(2n - 1)
Strobogrammatic Number II [Swift](./DFS/StrobogrammaticNumberII.swift) Medium O(mn) O(n)
Generalized Abbreviation [Swift](./DFS/GeneralizedAbbreviation.swift) Medium O(nn) O(2n)
Palindrome Partitioning [Swift](./DFS/PalindromePartitioning.swift) Medium O(nn) O(n)
Is Graph Bipartite [Swift](./DFS/IsGraphBipartite.swift) Medium O(n) O(n)
Number of Islands [Swift](./DFS/NumberofIslands.swift) Medium O((mn)2) O(1)
Walls and Gates [Swift](./DFS/WallsGates.swift) Medium O(nn) O(2n)
Word Search [Swift](./DFS/WordSearch.swift) Medium O((mn * 4 ^ (k - 1)) O(mn)
Word Search II [Swift](./DFS/WordSearchII.swift) Hard O(((mn)2)) O(n2)
Add and Search Word - Data structure design [Swift](./DFS/WordDictionary.swift) Medium O(n) O(n)
N-Queens [Swift](./DFS/NQueens.swift) Hard O((nn)) O(n2)
N-Queens II [Swift](./DFS/NQueensII.swift) Hard O((nn)) O(n)
Word Squares [Swift](./DFS/WordSquares.swift) Hard O((nn)) O(n)
Word Pattern II [Swift](./DFS/WordPatternII.swift) Hard O(nn) O(n)
Sudoku Solver [Swift](./DFS/SudokuSolver.swift) Hard O(n4) O(1)
Remove Invalid Parentheses [Swift](./DFS/RemoveInvalidParentheses.swift) Hard O(nn) O(n)
Expression Add Operators [Swift](./DFS/ExpressionAddOperators.swift) Hard O(nn) O(n)
Title Solution Difficulty Time Space
Word Ladder [Swift](./BFS/WordLadder.swift) Medium O(nm) O(nm)
Evaluate Division [Swift](./BFS/EvaluateDivision.swift) Medium O(n2) O(n)
Shortest Distance from All Buildings [Swift](./BFS/ShortestDistanceAllBuildings.swift) Hard O((mn)2) O(mn)

Math

Title Solution Difficulty Time Space
Add Binary [Swift](./Math/AddBinary.swift) Easy O(n) O(n)
Add Two Numbers [Swift](./Math/AddTwoNumbers.swift) Medium O(n) O(1)
Add Digits [Swift](./Math/AddDigits.swift) Easy O(1) O(1)
Plus One [Swift](./Math/PlusOne.swift) Easy O(n) O(1)
Missing Number [Swift](./Math/MissingNumber.swift) Easy O(n) O(1)
Divide Two Integers [Swift](./Math/DivideTwoIntegers.swift) Medium O(logn) O(1)
Number Complement [Swift](./Math/NumberComplement.swift) Easy O(n) O(1)
Hamming Distance [Swift](./Math/HammingDistance.swift) Easy O(n) O(1)
Integer Break [Swift](./Math/IntegerBreak.swift) Medium O(logn) O(1)
Factorial Trailing Zeroes [Swift](./Math/FactorialTrailingZeroes.swift) Medium O(logn) O(1)
Happy Number [Swift](./Math/HappyNumber.swift) Easy O(n) O(n)
Single Number [Swift](./Math/SingleNumber.swift) Medium O(n) O(1)
Ugly Number [Swift](./Math/UglyNumber.swift) Easy O(logn) O(1)
Ugly Number II [Swift](./Math/UglyNumberII.swift) Medium O(n) O(n)
Super Ugly Number [Swift](./Math/SuperUglyNumber.swift) Medium O(n2) O(n)
Count Primes [Swift](./Math/CountPrimes.swift) Easy O(n) O(n)
String to Integer (atoi) [Swift](./Math/Atoi.swift) Easy O(n) O(1)
Fraction to Recurring Decimal [Swift](./Math/FractionToRecurringDecimal.swift) Medium O(logn) O(n)
Pow(x, n) [Swift](./Math/Pow.swift) Medium O(logn) O(1)
Power of Two [Swift](./Math/PowerTwo.swift) Easy O(1) O(1)
Power of Three [Swift](./Math/PowerThree.swift) Easy O(1) O(1)
Super Power [Swift](./Math/SuperPow.swift) Medium O(n) O(1)
Sum of Two Integers [Swift](./Math/SumTwoIntegers.swift) Easy O(n) O(1)
Reverse Integer [Swift](./Math/ReverseInteger.swift) Easy O(n) O(1)
Excel Sheet Column Number [Swift](./Math/ExcelSheetColumnNumber.swift) Easy O(n) O(1)
Integer to Roman [Swift](./Math/IntegerToRoman.swift) Medium O(n) O(1)
Roman to Integer [Swift](./Math/RomanToInteger.swift) Easy O(n) O(n)
Integer to English Words [Swift](./Math/IntegerEnglishWords.swift) Hard O(n) O(1)
Rectangle Area [Swift](./Math/RectangleArea.swift) Easy O(1) O(1)
Minimum Moves to Equal Array Elements [Swift](./Math/MinimumMovesEqualArrayElements.swift) Easy O(n) O(1)
Trapping Rain Water [Swift](./Math/TrappingRainWater.swift) Hard O(n) O(n)
Container With Most Water [Swift](./Math/ContainerMostWater.swift) Medium O(n) O(1)
Counting Bits [Swift](./Math/CountingBits.swift) Medium O(n) O(n)
K-th Smallest in Lexicographical Order [Swift](./Math/KthSmallestLexicographicalOrder.swift) Hard O(n) O(1)
Gary Code [Swift](./Math/GaryCode.swift) Medium O(n) O(2n)
Permutation Sequence [Swift](./Math/PermutationSequence.swift) Medium O(n2) O(1)
Title Solution Difficulty Time Space
Closest Binary Search Tree Value [Swift](./Search/ClosestBinarySearchTreeValue.swift) Easy O(logn) O(1)
Closest Binary Search Tree Value II [Swift](./Search/ClosestBinarySearchTreeValueII.swift) Hard O(n) O(n)
Search in Rotated Sorted Array [Swift](./Search/SearchInRotatedSortedArray.swift) Hard O(logn) O(1)
Search in Rotated Sorted Array II [Swift](./Search/SearchInRotatedSortedArrayII.swift) Medium O(logn) O(1)
Find Minimum in Rotated Sorted Array [Swift](./Search/FindMinimumRotatedSortedArray.swift) Medium O(logn) O(1)
Find Minimum in Rotated Sorted Array II [Swift](./Search/FindMinimumRotatedSortedArrayII.swift) Hard O(logn) O(1)
Search a 2D Matrix [Swift](./Search/Search2DMatrix.swift) Medium O(log(m + n)) O(1)
Search a 2D Matrix II [Swift](./Search/Search2DMatrixII.swift) Medium O(m + n) O(1)
Search for a Range [Swift](./Search/SearchForARange.swift) Medium O(logn) O(1)
Search Insert Position [Swift](./Search/SearchForARange.swift) Medium O(logn) O(1)
Peak Index in a Mountain Array [Swift](./Search/PeakIndexMountainArray.swift) Easy O(logn) O(1)
Find Peak Element [Swift](./Search/FindPeakElement.swift) Medium O(logn) O(1)
Sqrt(x) [Swift](./Search/Sqrtx.swift) Medium O(logn) O(1)
Median of Two Sorted Arrays [Swift](./Search/MedianTwoSortedArrays.swift) Hard O(log(m + n)) O(1)
Minimize Max Distance to Gas Station [Swift](./Search/MinimizeMaxDistanceGasStation.swift) Hard O(nlogm) O(1)

Sort

Title Solution Difficulty Time Space
Merge Sorted Array [Swift](./Sort/MergeSortedArray.swift) Easy O(n) O(1)
Sort Colors [Swift](./Sort/SortColors.swift) Medium O(n) O(1)
Wiggle Sort [Swift](./Sort/WiggleSort.swift) Medium O(n) O(1)
Wiggle Sort II [Swift](./Sort/WiggleSortII.swift) Medium O(nlogn) O(n)
Sort Transformed Array [Swift](./Sort/SortTransformedArray.swift) Medium O(n) O(1)
Top K Frequent Elements [Swift](./Sort/TopKFrequentElements.swift) Medium O(nlogn) O(n)
Meeting Rooms [Swift](./Sort/MeetingRooms.swift) Easy O(nlogn) O(1)
Meeting Rooms II [Swift](./Sort/MeetingRoomsII.swift) Medium O(nlogn) O(n)
Merge Intervals [Swift](./Sort/MergeIntervals.swift) Hard O(nlogn) O(n)
Alien Dictionary [Swift](./Sort/AlienDictionary.swift) Hard O(nm) O(nm)
Kth Largest Element in an Array [Swift](./Sort/KthLargestElementInArray.swift) Medium O(nlogn) O(n)
Array Partition I [Swift](./Sort/ArrayPartitionI.swift) Easy O(nlogn) O(n)
Insert Interval [Swift](./Sort/InsertInterval.swift) Hard O(n) O(1)
Largest Number [Swift](./Sort/LargestNumber.swift) Medium O(nlogn) O(1)

Union Find

Title Solution Difficulty Time Space
Number of Connected Components in an Undirected Graph [Swift](./UnionFind/NumberConnectedComponentsUndirectedGraph.swift) Medium O(nlogn) O(n)
Graph Valid Tree [Swift](./UnionFind/GraphValidTree.swift) Medium O(nlogn) O(n)
Number of Islands II [Swift](./UnionFind/NumberIslandsII.swift) Hard O(klogmn) O(mn)

Design

Title Solution Difficulty Time Space
Shuffle an Array [Swift](./Design/ShuffleAnArray.swift) Easy O(n) O(1)
[Design Tic-Tac-Toe](https://leetcode.com/problems/design-tic-tac-toe/ [Swift](./Design/DesignTicTacToe.swift) Medium O(1) O(n)
Flatten 2D Vector [Swift](./Design/Vector2D.swift) Medium O(n) O(n)
Implement Trie (Prefix Tree) [Swift](./Design/ImplementTrie.swift) Medium O(n) O(n)
Insert Delete GetRandom O(1) [Swift](./Design/InsertDeleteGetRandom.swift) Medium O(1) O(n)
LRU Cache [Swift](./Design/LRUCache.swift) Hard O(1) O(n)

Google

Title Solution Difficulty Frequency
Plus One [Swift](./Math/PlusOne.swift) Easy ★★★★★★
Number of Islands [Swift](./DFS/NumberofIslands.swift) Medium ★★★★
Summary Ranges [Swift](./Array/SummaryRanges.swift) Medium ★★★★
Perfect Squares [Swift](./DP/PerfectSquares.swift) Medium ★★★★
Merge Intervals [Swift](./Sort/MergeIntervals.swift) Hard ★★★
Valid Parentheses [Swift](./Stack/ValidParentheses.swift) Easy ★★★
Trapping Rain Water [Swift](./Math/TrappingRainWater.swift) Hard ★★
Merge k Sorted Lists [Swift](./LinkedList/MergeKSortedLists.swift) Hard ★★
Longest Consecutive Sequence [Swift](./Array/LongestConsecutiveSequence.swift) Hard ★★
Find Peak Element [Swift](./Search/FindPeakElement.swift) Medium ★★
Power of Two [Swift](./Math/PowerTwo.swift) Easy ★★
Spiral Matrix [Swift](./Array/SpiralMatrix.swift) Medium ★★
Sliding Window Maximum [Swift](./Array/SlidingWindowMaximum.swift) Hard ★★
Pow(x, n) [Swift](./Math/Pow.swift) Medium ★★
Letter Combinations of a Phone Number [Swift](./DFS/LetterCombinationsPhoneNumber.swift) Medium ★★
Heaters [Swift](./Array/Heaters.swift) Easy

Facebook

Title Solution Difficulty Frequency
3Sum [Swift](./Array/ThreeSum.swift) Medium ★★★★★★
Valid Palindrome [Swift](./String/ValidPalindrome.swift) Easy ★★★★★★
Valid Palindrome II [Swift](./String/ValidPalindromeII.swift) Easy ★★★★★★
Move Zeroes [Swift](./Array/MoveZeroes.swift) Easy ★★★★★★
Remove Invalid Parentheses [Swift](./DFS/RemoveInvalidParentheses.swift) Hard ★★★★★★
Add Binary [Swift](./Math/AddBinary.swift) Easy ★★★★★
Two Sum [Swift](./Array/TwoSum.swift) Easy ★★★★★
Bnary Tree Paths [Swift](./Tree/BnaryTreePaths.swift) Easy ★★★★
Letter Combinations of a Phone Number [Swift](./DFS/LetterCombinationsPhoneNumber.swift) Medium ★★★★
Merge k Sorted Lists [Swift](./LinkedList/MergeKSortedLists.swift) Hard ★★★★
Reverse Linked List [Swift](./LinkedList/ReverseLinkedList.swift) Easy ★★★
Merge Intervals [Swift](./Sort/MergeIntervals.swift) Hard ★★★
Number of Islands [Swift](./DFS/NumberofIslands.swift) Medium ★★★
Reverse Linked List [Swift](./LinkedList/ReverseLinkedList.swift) Easy ★★★
Expression Add Operators [Swift](./DFS/ExpressionAddOperators.swift) Hard ★★★
Subsets [Swift](./DFS/Subsets.swift) Medium ★★★
Sort Colors [Swift](./Sort/SortColors.swift) Medium ★★

Snapchat

Title Solution Difficulty Frequency
Game of Life [Swift](./Array/GameLife.swift) Medium ★★★★★★
Meeting Rooms II [Swift](./Sort/MeetingRoomsII.swift) Medium ★★★★★★
Valid Sudoku [Swift](./Array/ValidSudoku.swift) Easy ★★★★★
Binary Tree Vertical Order Traversal [Swift](./Tree/BinaryTreeVerticalOrderTraversal.swift) Medium ★★★★
Alien Dictionary [Swift](./Sort/AlienDictionary.swift) Hard ★★★★
One Edit Distance [Swift](./String/OneEditDistance.swift) Medium ★★★
Sudoku Solver [Swift](./Math/SudokuSolver.swift) Hard ★★★
Reverse Linked List [Swift](./LinkedList/ReverseLinkedList.swift) Easy ★★
Unique Binary Search Trees [Swift](./Tree/UniqueBinarySearchTrees.swift) Medium ★★
Minimum Window Substring [Swift](./String/MinimumWindowSubstring.swift) Hard ★★
Remove K Digits [Swift](./Stack/RemoveKDigits.swift) Medium
Ternary Expression Parser [Swift](./Stack/TernaryExpressionParser.swift) Medium

Uber

Title Solution Difficulty Frequency
Valid Sudoku [Swift](./Array/ValidSudoku.swift) Easy ★★★★
Spiral Matrix [Swift](./Array/SpiralMatrix.swift) Medium ★★★★
Letter Combinations of a Phone Number [Swift](./DFS/LetterCombinationsPhoneNumber.swift) Medium ★★★★
Group Anagrams [Swift](./String/GroupAnagrams.swift) Medium ★★★★
Word Pattern [Swift](./String/WordPattern.swift) Easy ★★★
Roman to Integer [Swift](./Math/RomanToInteger.swift) Easy ★★★
Combination Sum [Swift](./DFS/CombinationSum.swift) Medium ★★

Airbnb

Title Solution Difficulty Frequency
Two Sum [Swift](./Array/TwoSum.swift) Easy ★★★★★
Text Justification [Swift](./String/TextJustification.swift) Hard ★★★★
House Robber [Swift](./DP/HouseRobber.swift) Easy ★★
Single Number [Swift](./Math/SingleNumber.swift) Medium ★★
Word Search II [Swift](./DFS/WordSearchII.swift) Hard ★★
Add Two Numbers [Swift](./Math/AddTwoNumbers.swift) Medium ★★

LinkedIn

Title Solution Difficulty Frequency
Maximum Subarray [Swift](./DP/MaximumSubarray.swift) Medium ★★★★★★
Pow(x, n) [Swift](./Math/Pow.swift) Medium ★★★★★★
Merge Intervals [Swift](./Sort/MergeIntervals.swift) Hard ★★★★★★
Isomorphic Strings [Swift](./String/IsomorphicStrings.swift) Easy ★★★★★★
Search in Rotated Sorted Array [Swift](./Search/SearchInRotatedSortedArray.swift) Hard ★★★★★
Search for a Range [Swift](./Search/SearchForARange.swift) Medium ★★★★★
Two Sum [Swift](./Array/TwoSum.swift) Easy ★★★★
Binary Tree Level Order Traversal [Swift](./Tree/BinaryTreeLevelOrderTraversal.swift) Easy ★★★★
Evaluate Reverse Polish Notation [Swift](./Stack/EvaluateReversePolishNotation.swift) Medium ★★★
Maximum Product Subarray [Swift](./DP/MaximumProductSubarray.swift) Medium ★★★
Product of Array Except Self [Swift](./Array/ProductExceptSelf.swift) Medium ★★★
Symmetric Tree [Swift](./Tree/SymmetricTree.swift) Easy ★★

Amazon

Title Solution Difficulty Frequency
Two Sum [Swift](./Array/TwoSum.swift) Easy ★★★★★★
Min Cost Climbing Stairs [Swift](./DP/MinCostClimbingStairs.swift) Easy ★★★★
Number of Islands [Swift](./DFS/NumberofIslands.swift) Medium ★★
Add Two Numbers [Swift](./Math/AddTwoNumbers.swift) Medium ★★
Reverse Linked List [Swift](./LinkedList/ReverseLinkedList.swift) Easy ★★
Valid Parentheses [Swift](./Stack/ValidParentheses.swift) Easy ★★
Longest Palindromic Substring [Swift](./DP/LongestPalindromicSubstring.swift) Medium ★★
Trapping Rain Water [Swift](./Math/TrappingRainWater.swift) Hard ★★
Longest Substring Without Repeating Characters [Swift](./String/LongestSubstringWithoutRepeatingCharacters.swift) Medium ★★
Letter Combinations of a Phone Number [Swift](./DFS/LetterCombinationsPhoneNumber.swift) Medium ★★
Valid Anagram [Swift](./String/ValidAnagram.swift) Easy ★★
Rotate Image [Swift](./Array/RotateImage.swift) Medium ★★
Best Time to Buy and Sell Stock [Swift](./DP/BestTimeBuySellStock.swift) Easy ★★
3Sum [Swift](./Array/ThreeSum.swift) Medium ★★
Sliding Window Maximum [Swift](./Array/SlidingWindowMaximum.swift) Hard ★★

Microsoft

Title Solution Difficulty Frequency
Reverse Linked List [Swift](./LinkedList/ReverseLinkedList.swift) Easy ★★★★★★
Two Sum [Swift](./Array/TwoSum.swift) Easy ★★★★★
String to Integer (atoi) [Swift](./Math/Atoi.swift) Easy ★★★★
Add Two Numbers [Swift](./Math/AddTwoNumbers.swift) Medium ★★★★
Excel Sheet Column Number [Swift](./Math/ExcelSheetColumnNumber.swift) Easy ★★★★
Validate Binary Search Tree [Swift](./Tree/ValidateBinarySearchTree.swift) Medium ★★★
Merge Two Sorted Lists [Swift](./LinkedList/MergeTwoSortedLists.swift) Easy ★★★

Problem Status

Solution Number Title Difficulty
[Swift](./LinkedList/LFUCache.swift) 460 LFU Cache Hard
[Swift](./Array/FindDisappearedNumbers.swift) 448 Find All Numbers Disappeared in an Array Easy
[Swift](./DFS/CombinationSumIV.swift) 377 Combination Sum IV Medium
376 Wiggle Subsequence Medium
[Swift](./DP/GuessNumberHigherOrLowerII.swift) 375 Guess Number Higher or Lower II Medium
374 Guess Number Higher or Lower Easy
373 Find K Pairs with Smallest Sums Medium
[Swift](./Math/SuperPow.swift) 372 Super Pow Medium
[Swift](./Math/SumTwoIntegers.swift) 371 Sum of Two Integers Easy
370 Range Addition Medium
369 Plus One Linked List Medium
368 Largest Divisible Subset Medium
367 Valid Perfect Square Medium
366 Find Leaves of Binary Tree Medium
365 Water and Jug Problem Medium
364 Nested List Weight Sum II Medium
363 Max Sum of Rectangle No Larger Than K Hard
362 Design Hit Counter Medium
361 Bomb Enemy Medium
[Swift](./Sort/SortTransformedArray.swift) 360 Sort Transformed Array Medium
359 Logger Rate Limiter Easy
358 Rearrange String k Distance Apart Hard
357 Count Numbers with Unique Digits Medium
356 Line Reflection Medium
355 Design Twitter Medium
354 Russian Doll Envelopes Hard
353 Design Snake Game Medium
352 Data Stream as Disjoint Intervals Hard
351 Android Unlock Patterns Medium
[Swift](./Array/IntersectionTwoArraysII.swift) 350 Intersection of Two Arrays II Easy
[Swift](./Array/IntersectionTwoArrays.swift) 349 Intersection of Two Arrays Easy
348 Design Tic-Tac-Toe Medium
[Swift](./Sort/TopKFrequentElements.swift) 347 Top K Frequent Elements Medium
346 Moving Average from Data Stream Easy
[Swift](./String/ReverseVowelsOfAString.swift) 345 Reverse Vowels of a String Easy
[Swift](./String/ReverseString.swift) 344 Reverse String Easy
[Swift](./Math/IntegerBreak.swift) 343 Integer Break Medium
342 Power of Four Easy
341 Flatten Nested List Iterator Medium
[Swift](./String/LongestSubstringMostKDistinctCharacters.swift) 340 Longest Substring with At Most K Distinct Characters Hard
[Swift](./DP/NestedListWeightSum.swift) 339 Nested List Weight Sum Easy
[Swift](./Math/CountingBits.swift) 338 Counting Bits Medium
[Swift](./Tree/HouseRobberIII.swift) 337 House Robber III Medium
336 Palindrome Pairs Hard
335 Self Crossing Hard
[Swift](./Tree/IncreasingTripletSubsequence.swift) 334 Increasing Triplet Subsequence Medium
333 Largest BST Subtree Medium
332 Reconstruct Itinerary Medium
331 Verify Preorder Serialization of a Binary Tree Medium
330 Patching Array Hard
329 Longest Increasing Path in a Matrix Hard
[Swift](./LinkedList/OddEvenLinkedList.swift) 328 Odd Even Linked List Medium
327 Count of Range Sum Hard
[Swift](./Math/PowerThree.swift) 326 Power of Three Easy
[Swift](./Array/MaximumSizeSubarraySumEqualsK.swift) 325 Maximum Size Subarray Sum Equals k Medium
[Swift](./Sort/WiggleSortII.swift) 324 Wiggle Sort II Medium
[Swift](./Sort/NumberConnectedComponentsUndirectedGraph.swift) 323 Number of Connected Components in an Undirected Graph Medium
[Swift](./DP/CoinChange.swift) 322 Coin Change Medium
[Swift](./Array/CreateMaximumNumber.swift) 321 Create Maximum Number Hard
[Swift](./DFS/GeneralizedAbbreviation.swift) 320 Generalized Abbreviation Medium
319 Bulb Switcher Medium
318 Maximum Product of Word Lengths Medium
[Swift](./BFS/ShortestDistanceAllBuildings.swift) 317 Shortest Distance from All Buildings Hard
316 Remove Duplicate Letters Hard
315 Count of Smaller Numbers After Self Hard
[Swift](./Tree/BinaryTreeVerticalOrderTraversal.swift) 314 Binary Tree Vertical Order Traversal Medium
[Swift](./Math/SuperUglyNumber.swift) 313 Super Ugly Number Medium
[Swift](./DP/GuessNumberHigherOrLowerII.swift) 312 Burst Balloons Hard
311 Sparse Matrix Multiplication Medium
310 Minimum Height Trees Medium
[Swift](./DP/BestTimeBuySellStockCooldown.swift) 309 Best Time to Buy and Sell Stock with Cooldown Medium
308 Range Sum Query 2D - Mutable Hard
307 Range Sum Query - Mutable Medium
306 Additive Number Medium
[Swift](./UnionFind/NumberIslandsII.swift) 305 Number of Islands II Hard
[Swift](./Array/NumMatrix.swift) 304 Range Sum Query 2D - Immutable Medium
303 Range Sum Query - Immutable Easy
302 Smallest Rectangle Enclosing Black Pixels Hard
[Swift](./DFS/RemoveInvalidParentheses.swift) 301 Remove Invalid Parentheses Hard
[Swift](./DP/LongestIncreasingSubsequence.swift) 300 Longest Increasing Subsequence Medium
299 Bulls and Cows Easy
298 Binary Tree Longest Consecutive Sequence Medium
297 Serialize and Deserialize Binary Tree Hard
[Swift](./Tree/UniqueBinarySearchTrees.swift) 296 Best Meeting Point Hard
295 Find Median from Data Stream Hard
[Swift](./DP/FlipGameII.swift) 294 Flip Game II Medium
[Swift](./String/FlipGame.swift) 293 Flip Game Easy
292 Nim Game Easy
291 Word Pattern II Hard
[Swift](./String/WordPattern.swift) 290 Word Pattern Easy
[Swift](./Array/GameLife.swift) 289 Game of Life Medium
288 Unique Word Abbreviation Easy
287 Find the Duplicate Number Hard
[Swift](./DFS/NumberofIslands.swift) 286 Walls and Gates Medium
285 Inorder Successor in BST Medium
284 Peeking Iterator Medium
[Swift](./Array/MoveZeroes.swift) 283 Move Zeroes Easy
[Swift](./DFS/ExpressionAddOperators.swift) 282 Expression Add Operators Hard
281 Zigzag Iterator Medium
[Swift](./Sort/WiggleSort.swift) 280 Wiggle Sort Medium
[Swift](./DP/PerfectSquares.swift) 279 Perfect Squares Medium
278 First Bad Version Easy
277 Find the Celebrity Medium
[Swift](./DP/PaintFence.swift) 276 Paint Fence Easy
275 H-Index II Medium
274 H-Index Medium
[Swift](./Math/IntegerEnglishWords.swift) 273 Integer to English Words Hard
[Swift](./Search/ClosestBinarySearchTreeValueII.swift) 272 Closest Binary Search Tree Value II Hard
271 Encode and Decode Strings Medium
[Swift](./Search/ClosestBinarySearchTreeValue.swift) 270 Closest Binary Search Tree Value Easy
[Swift](./Sort/AlienDictionary.swift) 269 Alien Dictionary Hard
[Swift](./Math/MissingNumber.swift) 268 Missing Number Easy
267 Palindrome Permutation II Medium
[Swift](./String/PalindromePermutation.swift) 266 Palindrome Permutation Easy
265 Paint House II Hard
[Swift](./Math/UglyNumberII.swift) 264 Ugly Number II Medium
[Swift](./Math/UglyNumber.swift) 263 Ugly Number Easy
[Swift](./Sort/GraphValidTree.swift) 261 Graph Valid Tree Medium
260 Single Number III Medium
259 3Sum Smaller Medium
[Swift](./Math/AddDigits.swift) 258 Add Digits Easy
[Swift](./Tree/BnaryTreePaths.swift) 257 Binary Tree Paths Easy
256 Paint House Medium
255 Verify Preorder Sequence in Binary Search Tree Medium
[Swift](./DFS/FactorCombinations.swift) 254 Factor Combinations Medium
[Swift](./Sort/MeetingRoomsII.swift) 253 Meeting Rooms II Medium
[Swift](./Sort/MeetingRooms.swift) 252 Meeting Rooms Easy
[Swift](./Design/Vector2D.swift) 251 Flatten 2D Vector Medium
250 Count Univalue Subtrees Medium
249 Group Shifted Strings Easy
248 Strobogrammatic Number III Hard
[Swift](./DFS/StrobogrammaticNumberII.swift) 247 Strobogrammatic Number II Medium
[Swift](./Array/StrobogrammaticNumber.swift) 246 Strobogrammatic Number Easy
[Swift](./Array/ShortestWordDistanceIII.swift) 245 Shortest Word Distance III Medium
244 Shortest Word Distance II Medium
[Swift](./String/ShortestWordDistance.swift) 243 Shortest Word Distance Easy
[Swift](./String/ValidAnagram.swift) 242 Valid Anagram Easy
[Swift](./DP/DifferentWaysAddParentheses.swift) 241 Different Ways to Add Parentheses Medium
[Swift](./Search/Search2DMatrixII.swift) 240 Search a 2D Matrix II Medium
[Swift](./Array/SlidingWindowMaximum.swift) 239 Sliding Window Maximum Hard
[Swift](./Array/ProductExceptSelf.swift) 238 Product of Array Except Self Medium
237 Delete Node in a Linked List Easy
236 Lowest Common Ancestor of a Binary Tree Medium
235 Lowest Common Ancestor of a Binary Search Tree Easy
[Swift](./LinkedList/PalindromeLinkedList.swift) 234 Palindrome Linked List Easy
233 Number of Digit One Hard
[Swift](./Queue/ImplementQueueUsingStacks.swift) 232 Implement Queue using Stacks Easy
[Swift](./Math/PowerTwo.swift) 231 Power of Two Easy
[Swift](./Tree/KthSmallestElementBST.swift) 230 Kth Smallest Element in a BST Medium
[Swift](./Array/MajorityElementII.swift) 229 Majority Element II Medium
[Swift](./Array/SummaryRanges.swift) 228 Summary Ranges Medium
227 Basic Calculator II Medium
[Swift](./Tree/InvertBinaryTree.swift) 226 Invert Binary Tree Easy
225 Implement Stack using Queues Easy
224 Basic Calculator Hard
[Swift](./Math/RectangleArea.swift) 223 Rectangle Area Easy
222 Count Complete Tree Nodes Medium
[Swift](./DP/MaximalSquare.swift) 221 Maximal Square Medium
220 Contains Duplicate III Medium
[Swift](./Array/ContainsDuplicateII.swift) 219 Contains Duplicate II Easy
218 The Skyline Problem Hard
[Swift](./Array/ContainsDuplicate.swift) 217 Contains Duplicate Easy
[Swift](./DFS/combinationSumIII.swift) 216 Combination Sum III Medium
[Swift](./Sort/KthLargestElementInArray.swift) 215 Kth Largest Element in an Array Medium
214 Shortest Palindrome Hard
[Swift](./DP/HouseRobberII.swift) 213 House Robber II Medium
[Swift](./DFS/WordSearchII.swift) 212 Word Search II Hard
[Swift](./DFS/WordDictionary.swift) 211 Add and Search Word - Data structure design Medium
210 Course Schedule II Medium
[Swift](./Array/MinimumSizeSubarraySum.swift) 209 Minimum Size Subarray Sum Medium
[Swift](./Design/ImplementTrie.swift) 208 Implement Trie (Prefix Tree) Medium
207 Course Schedule Medium
[Swift](./LinkedList/ReverseLinkedList.swift) 206 Reverse Linked List Easy
[Swift](./String/IsomorphicStrings.swift) 205 Isomorphic Strings Easy
[Swift](./Math/CountPrimes.swift) 204 Count Primes Easy
[Swift](./LinkedList/RemoveLinkedListElements.swift) 203 Remove Linked List Elements Easy
[Swift](./Math/HappyNumber.swift) 202 Happy Number Easy
201 Bitwise AND of Numbers Range Medium
[Swift](./DFS/NumberofIslands.swift) 200 Number of Islands Medium
[Swift](./Tree/BinaryTreeRightSideView.swift) 199 Binary Tree Right Side View Medium
[Swift](./DP/HouseRobber.swift) 198 House Robber Easy
191 Number of 1 Bits Easy
190 Reverse Bits Easy
[Swift](./Array/RotateArray.swift) 189 Rotate Array Easy
[Swift](./DP/BestTimeBuySellStockIV.swift) 188 Best Time to Buy and Sell Stock IV Hard
187 Repeated DNA Sequences Medium
[Swift](./String/ReverseWordsStringII.swift) 186 Reverse Words in a String II Medium
[Swift]((./Sort/LargestNumber.swift)) 179 Largest Number Medium
174 Dungeon Game Hard
173 Binary Search Tree Iterator Medium
[Swift](./Math/FactorialTrailingZeroes.swift) 172 Factorial Trailing Zeroes Easy
[Swift](./Math/ExcelSheetColumnNumber.swift) 171 Excel Sheet Column Number Easy
170 Two Sum III - Data structure design Easy
[Swift](./Array/MajorityElement.swift) 169 Majority Element Easy
168 Excel Sheet Column Title Easy
167 Two Sum II - Input array is sorted Medium
[Swift](./Math/FractionToRecurringDecimal.swift) 166 Fraction to Recurring Decimal Medium
165 Compare Version Numbers Easy
164 Maximum Gap Hard
[Swift](./Array/MissingRanges.swift) 163 Missing Ranges Medium
[Swift](./Search/FindPeakElement.swift) 162 Find Peak Element Medium
[Swift](./String/OneEditDistance.swift) 161 One Edit Distance Medium
160 Intersection of Two Linked Lists Easy
[Swift](./String/LongestSubstringMostTwoDistinctCharacters.swift) 159 Longest Substring with At Most Two Distinct Characters Hard
158 Read N Characters Given Read4 II - Call multiple times Hard
157 Read N Characters Given Read4 Easy
[Swift](./Tree/BinaryTreeUpsideDown) 156 Binary Tree Upside Down Medium
[Swift](./Stack/MinStack.swift) 155 Min Stack Easy
[Swift](./Search/FindMinimumRotatedSortedArrayII.swift) 154 Find Minimum in Rotated Sorted Array II Hard
[Swift](./Search/FindMinimumRotatedSortedArray.swift) 153 Find Minimum in Rotated Sorted Array Medium
[Swift](./DP/MaximumProductSubarray.swift) 152 Maximum Product Subarray Medium
[Swift](./String/ReverseWordsString.swift) 151 Reverse Words in a String Medium
[Swift](./Stack/EvaluateReversePolishNotation.swift) 150 Evaluate Reverse Polish Notation Medium
149 Max Points on a Line Hard
148 Sort List Medium
147 Insertion Sort List Medium
[Swift](./LinkedList/LRUCache.swift) 146 LRU Cache Hard
[Swift](./Stack/PostorderTraversal.swift) 145 Binary Tree Postorder Traversal Hard
[Swift](./Stack/PreorderTraversal.swift) 144 Binary Tree Preorder Traversal Medium
[Swift](./LinkedList/ReorderList.swift) 143 Reorder List Medium
142 Linked List Cycle II Medium
141 Linked List Cycle Easy
140 Word Break II Hard
139 Word Break Medium
138 Copy List with Random Pointer Hard
[Swift](./Math/SingleNumberII.swift) 137 Single Number II Medium
[Swift](./Math/SingleNumber.swift) 136 Single Number Medium
135 Candy Hard
[Swift](./Array/GasStation.swift) 134 Gas Station Medium
133 Clone Graph Medium
132 Palindrome Partitioning II Hard
[Swift](./DFS/PalindromePartitioning.swift) 131 Palindrome Partitioning Medium
130 Surrounded Regions Medium
129 Sum Root to Leaf Numbers Medium
[Swift](./Array/LongestConsecutiveSequence.swift) 128 Longest Consecutive Sequence Hard
[Swift](./BFS/WordLadder.swift) 127 Word Ladder Medium
126 Word Ladder II Hard
[Swift](./String/ValidPalindrome.swift) 125 Valid Palindrome Easy
124 Binary Tree Maximum Path Sum Hard
[Swift](./DP/BestTimeBuySellStockIII.swift) 123 Best Time to Buy and Sell Stock III Hard
[Swift](./DP/BestTimeBuySellStockII.swift) 122 Best Time to Buy and Sell Stock II Medium
[Swift](./DP/BestTimeBuySellStock.swift) 121 Best Time to Buy and Sell Stock Easy
[Swift](./DP/Triangle.swift) 120 Triangle Medium
119 Pascal's Triangle II Easy
118 Pascal's Triangle Easy
117 Populating Next Right Pointers in Each Node II Hard
116 Populating Next Right Pointers in Each Node Medium
115 Distinct Subsequences Hard
[Swift](./Tree/FlattenBinaryTreeLinkedList.swift) 114 Flatten Binary Tree to Linked List Medium
[Swift](./Tree/PathSumII.swift) 113 Path Sum II Medium
[Swift](./Tree/PathSum.swift) 112 Path Sum Easy
[Swift](./Tree/MinimumDepthOfBinaryTree.swift) 111 Minimum Depth of Binary Tree Easy
[Swift](./Tree/BalancedBinaryTree.swift) 110 Balanced Binary Tree Easy
109 Convert Sorted List to Binary Search Tree Medium
[Swift](./Tree/ConvertSortedArrayBinarySearchTree.swift) 108 Convert Sorted Array to Binary Search Tree Medium
[Swift](./Tree/BinaryTreeLevelOrderTraversalII.swift) 107 Binary Tree Level Order Traversal II Easy
[Swift](./Tree/ConstructBinaryTreeInorderPostorder.swift) 106 Construct Binary Tree from Inorder and Postorder Traversal Medium
[Swift](./Tree/ConstructBinaryTreePreorderInorder.swift) 105 Construct Binary Tree from Preorder and Inorder Traversal Medium
[Swift](./Tree/MaximumDepthOfBinaryTree.swift) 104 Maximum Depth of Binary Tree Easy
[Swift](./Tree/BinaryTreeZigzagLevelOrderTraversal.swift) 103 Binary Tree Zigzag Level Order Traversal Medium
[Swift](./Tree/BinaryTreeLevelOrderTraversal.swift) 102 Binary Tree Level Order Traversal Easy
[Swift](./Tree/SymmetricTree.swift) 101 Symmetric Tree Easy
[Swift](./Tree/SameTree.swift) 100 Same Tree Easy
[Swift](./Tree/RecoverBinarySearchTree.swift) 99 Recover Binary Search Tree Hard
[Swift](./Tree/ValidateBinarySearchTree.swift) 98 Validate Binary Search Tree Medium
97 Interleaving String Hard
[Swift](./Tree/UniqueBinarySearchTrees.swift) 96 Unique Binary Search Trees Medium
95 Unique Binary Search Trees II Medium
[Swift](./Stack/InorderTraversal.swift) 94 Binary Tree Inorder Traversal Medium
93 Restore IP Addresses Medium
92 Reverse Linked List II Medium
[Swift](./DP/DecodeWays.swift) 91 Decode Ways Medium
[Swift](./DFS/SubsetsII.swift) 90 Subsets II Medium
[Swift](./Math/GaryCode.swift) 89 Gray Code Medium
[Swift](./Sort/MergeSortedArray.swift) 88 Merge Sorted Array Easy
87 Scramble String Hard
[Swift](./LinkedList/PartitionList.swift) 86 Partition List Medium
85 Maximal Rectangle Hard
84 Largest Rectangle in Histogram Hard
[Swift](./LinkedList/RemoveDuplicatesFromSortedList.swift) 83 Remove Duplicates from Sorted List Easy
[Swift](./LinkedList/RemoveDuplicatesFromSortedListII.swift) 82 Remove Duplicates from Sorted List II Medium
[Swift](./Search/SearchInRotatedSortedArrayII.swift) 81 Search in Rotated Sorted Array II Medium
[Swift](./Array/RemoveDuplicatesFromSortedArrayII.swift) 80 Remove Duplicates from Sorted Array II Medium
[Swift](./DFS/WordSearch.swift) 79 Word Search Medium
[Swfit](./DFS/Subsets.swift) 78 Subsets Medium
[Swift](./DFS/combinations.swift) 77 Combinations Medium
[Swift](./Array/MinimumWindowSubstring.swift) 76 Minimum Window Substring Hard
[Swift](./Sort/SortColors.swift) 75 Sort Colors Medium
[Swift](./Search/Search2DMatrix.swift) 74 Search a 2D Matrix Medium
[Swift](./Array/SetMatrixZero.swift) 73 Set Matrix Zeroes Medium
[Swift](./DP/EditDistance.swift) 72 Edit Distance Hard
[Swift](./Stack/SimplifyPath.swift) 71 Simplify Path Medium
[Swift](./DP/ClimbingStairs.swift) 70 Climbing Stairs Easy
[Swift](./Search/Sqrtx.swift) 69 Sqrt(x) Medium
[Swift](./String/TextJustification.swift) 68 Text Justification Hard
[Swift](./Math/AddBinary.swift) 67 Add Binary Easy
[Swift](./Math/PlusOne.swift) 66 Plus One Easy
65 Valid Number Hard
[Swift](./DP/MinimumPathSum.swift) 64 Minimum Path Sum Medium
[Swift](./DP/UniquePathsII.swift) 63 Unique Paths II Medium
[Swift](./DP/UniquePaths.swift) 62 Unique Paths Medium
[Swift](./LinkedList/RotateList.swift) 61 Rotate List Medium
[Swift](./Math/PermutationSequence.swift) 60 Permutation Sequence Medium
[Swift](./Array/SpiralMatrixII.swift) 59 Spiral Matrix II Medium
[Swift](./String/LengthLastWord.swift) 58 Length of Last Word Easy
[Swift](./Sort/InsertInterval.swift) 57 Insert Interval Hard
[Swift](./Sort/MergeIntervals.swift) 56 Merge Intervals Hard
[Swift](./DP/JumpGame.swift) 55 Jump Game Medium
[Swift](./Array/SpiralMatrix.swift) 54 Spiral Matrix Medium
[Swift](./DP/MaximumSubarray.swift) 53 Maximum Subarray Medium
[Swift](./DFS/NQueensII.swift) 52 N-Queens II Hard
[Swift](./DFS/NQueens.swift) 51 N-Queens Hard
[Swift](./Math/Pow.swift) 50 "Pow(x, n)" Medium
[Swift](./String/GroupAnagrams.swift) 49 Group Anagrams Medium
[Swift](./Array/RotateImage.swift) 48 Rotate Image Medium
[Swift](./DFS/PermutationsII.swift) 47 Permutations II Medium
[Swift](./DFS/Permutations.swift) 46 Permutations Medium
45 Jump Game II Hard
[Swift](./DP/WildcardMatching.swift) 44 Wildcard Matching Hard
[Swift](./String/MultiplyStrings.swift) 43 Multiply Strings Medium
[Swift](./Math/TrappingRainWater.swift) 42 Trapping Rain Water Hard
[Swift](./Array/FirstMissingPositive.swift) 41 First Missing Positive Hard
[Swift](./DFS/combinationSumII.swiftc) 40 Combination Sum II Medium
[Swift](./DFS/CombinationSum.swift) 39 Combination Sum Medium
[Swift](./String/CountAndSay.swift) 38 Count and Say Easy
[Swift](./Math/SudokuSolver.swift) 37 Sudoku Solver Hard
[Swift](./Array/ValidSudoku.swift) 36 Valid Sudoku Easy
[Swift](./Search/SearchInsertPosition.swift) 35 Search Insert Position Medium
[Swift](./Search/SearchForARange.swift) 34 Search for a Range Medium
[Swift](./Search/SearchInRotatedSortedArray.swift) 33 Search in Rotated Sorted Array Hard
[Swift](./Stack/LongestValidParentheses.swift) 32 Longest Valid Parentheses Hard
[Swift](./Array/NextPermutation.swift) 31 Next Permutation Medium
30 Substring with Concatenation of All Words Hard
[Swift](./Math/DivideTwoIntegers.swift) 29 Divide Two Integers Medium
[Swift](./String/StrStr.swift) 28 Implement strStr() Easy
[Swfit](./Array/RemoveElement.swift) 27 Remove Element Easy
[Swift](./Array/RemoveDuplicatesFromSortedArray.swift) 26 Remove Duplicates from Sorted Array Easy
25 Reverse Nodes in k-Group Hard
[Swift](./LinkedList/SwapNodesInPairs.swift) 24 Swap Nodes in Pairs Easy
[Swift](./LinkedList/MergeKSortedLists.swift) 23 Merge k Sorted Lists Hard
[Swift](./Math/GenerateParentheses.swift) 22 Generate Parentheses Medium
[Swift](./LinkedList/MergeTwoSortedLists.swift) 21 Merge Two Sorted Lists Easy
[Swift](./Stack/ValidParentheses.swift) 20 Valid Parentheses Easy
[Swift](./LinkedList/RemoveNthFromEnd.swift) 19 Remove Nth Node From End of List Easy
[Swift](./Array/FourSum.swift) 18 4Sum Medium
[Swift](./DFS/LetterCombinationsPhoneNumber.swift) 17 Letter Combinations of a Phone Number Medium
[Swift](./Array/ThreeSum.swift) 16 3Sum Closest Medium
[Swift](./Array/ThreeSum.swift) 15 3Sum Medium
[Swift](./String/LongestCommonPrefix.swift) 14 Longest Common Prefix Easy
[Swift](./Math/RomanToInteger.swift) 13 Roman to Integer Easy
[Swift](./Math/IntegerToRoman.swift) 12 Integer to Roman Medium
[Swift](./Math/ContainerMostWater.swift) 11 Container With Most Water Medium
[Swift](./DP/RegularExpressionMatching.swift) 10 Regular Expression Matching Hard
[Swift](./Math/PalindromeNumber.swift) 9 Palindrome Number Easy
[Swift](./Math/Atoi.swift) 8 String to Integer (atoi) Easy
[Swift](./Math/ReverseInteger.swift) 7 Reverse Integer Easy
[Swift](./String/ZigZagConversion.swift) 6 ZigZag Conversion Easy
[Swift](./DP/LongestPalindromicSubstring.swift) 5 Longest Palindromic Substring Medium
[Swift](./Search/MedianOfTwoSortedArrays.swift) 4 Median of Two Sorted Arrays Hard
[Swift](./String/LongestSubstringWithoutRepeatingCharacters.swift) 3 Longest Substring Without Repeating Characters Medium
[Swift](./Math/AddTwoNumbers.swift) 2 Add Two Numbers Medium
[Swift](./Array/TwoSum.swift) 1 Two Sum Easy