diff --git a/README.md b/README.md index 042415b15..53dc35bd2 100644 --- a/README.md +++ b/README.md @@ -1,190 +1,204 @@ LeetCode ======== -LeetCode C++ Solutions +###LeetCode Algorithm (Notes: "♥" means you need buy a book from Leetcode) | # | Title | Solution | Difficulty | |---| ----- | -------- | ---------- | -|181|[Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/)| [C++](./src/numberOf1Bits/numberOf1Bits.cpp)|Easy| -|180|[Reverse Bits](https://leetcode.com/problems/reverse-bits/)| [C++](./src/reverseBits/reverseBits.cpp)|Easy| -|179|[Rotate Array](https://leetcode.com/problems/rotate-array/)| [C++](./src/rotateArray/rotateArray.cpp)|Easy| -|178|[Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/)| [C++](./src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp)|Hard| -|177|[Repeated DNA Sequences](https://oj.leetcode.com/problems/repeated-dna-sequences/)| [C++](./src/repeatedDNASequences/repeatedDNASequences.cpp)|Medium| -|176|[Reverse Words in a String II](https://oj.leetcode.com/problems/reverse-words-in-a-string-ii/) ♥ | [C++](./src/reverseWordsInAString/reverseWordsInAString.II.cpp)|Medium| -|175|[Largest Number](https://oj.leetcode.com/problems/largest-number/) | [C++](./src/largestNumber/largestNumber.cpp)|Medium| -|174|[Dungeon Game](https://oj.leetcode.com/problems/dungeon-game/) | [C++](./src/dungeonGame/dungeonGame.cpp)|Hard| -|173|[Binary Search Tree Iterator](https://oj.leetcode.com/problems/binary-search-tree-iterator/) | [C++](./src/binarySearchTreeIterator/binarySearchTreeIterator.cpp)|Medium| -|172|[Factorial Trailing Zeroes](https://oj.leetcode.com/problems/factorial-trailing-zeroes/) | [C++](./src/factorialTrailingZeroes/factorialTrailingZeroes.cpp)|Easy| -|171|[Excel Sheet Column Number](https://oj.leetcode.com/problems/excel-sheet-column-number/) | [C++](./src/excelSheetColumnNumber/excelSheetColumnNumber.cpp)|Easy| -|170|[Two Sum III - Data structure design](https://oj.leetcode.com/problems/two-sum-iii-data-structure-design/) ♥ | [C++](./src/twoSum/twoSum.III.cpp)|Easy| -|169|[Majority Element](https://oj.leetcode.com/problems/majority-element/) | [C++](./src/majorityElement/majorityElement.cpp)|Easy| -|168|[Excel Sheet Column Title](https://oj.leetcode.com/problems/excel-sheet-column-title/) | [C++](./src/excelSheetColumnTitle/excelSheetColumnTitle.cpp)|Easy| -|167|[Two Sum II - Input array is sorted](https://oj.leetcode.com/problems/two-sum-ii-input-array-is-sorted/) ♥ | [C++](./src/twoSum/twoSum.II.cpp)|Medium| -|166|[Fraction to Recurring Decimal](https://oj.leetcode.com/problems/fraction-to-recurring-decimal/) | [C++](./src/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp)|Medium| -|165|[Compare Version Numbers](https://oj.leetcode.com/problems/compare-version-numbers/) | [C++](./src/compareVersionNumbers/compareVersionNumbers.cpp)|Easy| -|164|[Maximum Gap](https://oj.leetcode.com/problems/maximum-gap/) | [C++](./src/maximumGap/maximumGap.cpp)|Hard| -|163|[Missing Ranges](https://oj.leetcode.com/problems/missing-ranges/) ♥ | [C++](./src/missingRanges/missingRanges.cpp)|Medium| -|162|[Find Peak Element](https://oj.leetcode.com/problems/find-peak-element/) | [C++](./src/findPeakElement/findPeakElement.cpp)|Medium| -|161|[One Edit Distance](https://oj.leetcode.com/problems/one-edit-distance/)♥ | [C++](./src/oneEditDistance/oneEditDistance.cpp)|Medium| -|160|[Intersection of Two Linked Lists](https://oj.leetcode.com/problems/intersection-of-two-linked-lists/) | [C++](./src/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp)|Easy| -|159|[Longest Substring with At Most Two Distinct Characters](https://oj.leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/) ♥ | [C++](./src/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp)|Hard| -|158|[Read N Characters Given Read4 II - Call multiple times](https://oj.leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times/) ♥ | [C++](./src/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp)|Hard| -|157|[Read N Characters Given Read4](https://oj.leetcode.com/problems/read-n-characters-given-read4/) ♥ | [C++](./src/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp)|Easy| -|156|[Binary Tree Upside Down](https://oj.leetcode.com/problems/binary-tree-upside-down/) ♥ | [C++](./src/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp)|Medium| -|155|[Min Stack](https://oj.leetcode.com/problems/min-stack/)| [C++](./src/minStack/minStack.cpp)|Easy| -|154|[Find Minimum in Rotated Sorted Array II](https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)| [C++](./src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp)|Hard| -|153|[Find Minimum in Rotated Sorted Array](https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/)| [C++](./src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp)|Medium| -|152|[Maximum Product Subarray](https://oj.leetcode.com/problems/maximum-product-subarray/)| [C++](./src/maximumProductSubarray/maximumProductSubarray.cpp)|Medium| -|151|[Reverse Words in a String](https://oj.leetcode.com/problems/reverse-words-in-a-string/)| [C++](./src/reverseWordsInAString/reverseWordsInAString.cpp)|Medium| -|150|[Evaluate Reverse Polish Notation](https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/)| [C++](./src/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp)|Medium| -|149|[Max Points on a Line](https://oj.leetcode.com/problems/max-points-on-a-line/)| [C++](./src/maxPointsOnALine/maxPointsOnALine.cpp)|Hard| -|148|[Sort List](https://oj.leetcode.com/problems/sort-list/)| [C++](./src/sortList/sortList.cpp)|Medium| -|147|[Insertion Sort List](https://oj.leetcode.com/problems/insertion-sort-list/)| [C++](./src/insertionSortList/insertionSortList.cpp)|Medium| -|146|[LRU Cache](https://oj.leetcode.com/problems/lru-cache/)| [C++](./src/LRUCache/LRUCache.cpp)|Hard| -|145|[Binary Tree Postorder Traversal](https://oj.leetcode.com/problems/binary-tree-postorder-traversal/)| [C++](./src/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp)|Hard| -|144|[Binary Tree Preorder Traversal](https://oj.leetcode.com/problems/binary-tree-preorder-traversal/)| [C++](./src/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp)|Medium| -|143|[Reorder List](https://oj.leetcode.com/problems/reorder-list/)| [C++](./src/reorderList/reorderList.cpp)|Medium| -|142|[Linked List Cycle II](https://oj.leetcode.com/problems/linked-list-cycle-ii/)| [C++](./src/linkedListCycle/linkedListCycle.II.cpp)|Medium| -|141|[Linked List Cycle](https://oj.leetcode.com/problems/linked-list-cycle/)| [C++](./src/linkedListCycle/linkedListCycle.cpp)|Medium| -|140|[Word Break II](https://oj.leetcode.com/problems/word-break-ii/)| [C++](./src/wordBreak/wordBreak.II.cpp)|Hard| -|139|[Word Break](https://oj.leetcode.com/problems/word-break/)| [C++](./src/wordBreak/wordBreak.cpp)|Medium| -|138|[Copy List with Random Pointer](https://oj.leetcode.com/problems/copy-list-with-random-pointer/)| [C++](./src/copyListWithRandomPointer/copyListWithRandomPointer.cpp)|Hard| -|137|[Single Number II](https://oj.leetcode.com/problems/single-number-ii/)| [C++](./src/singleNumber/singleNumber.II.cpp)|Medium| -|136|[Single Number](https://oj.leetcode.com/problems/single-number/)| [C++](./src/singleNumber/singleNumber.cpp)|Medium| -|135|[Candy](https://oj.leetcode.com/problems/candy/)| [C++](./src/candy/candy.cpp)|Hard| -|134|[Gas Station](https://oj.leetcode.com/problems/gas-station/)| [C++](./src/gasStation/gasStation.cpp)|Medium| -|133|[Clone Graph](https://oj.leetcode.com/problems/clone-graph/)| [C++](./src/cloneGraph/cloneGraph.cpp)|Medium| -|132|[Palindrome Partitioning II](https://oj.leetcode.com/problems/palindrome-partitioning-ii/)| [C++](./src/palindromePartitioning/palindromePartitioning.II.cpp)|Hard| -|131|[Palindrome Partitioning](https://oj.leetcode.com/problems/palindrome-partitioning/)| [C++](./src/palindromePartitioning/palindromePartitioning.cpp)|Medium| -|130|[Surrounded Regions](https://oj.leetcode.com/problems/surrounded-regions/)| [C++](./src/surroundedRegions/surroundedRegions.cpp)|Medium| -|129|[Sum Root to Leaf Numbers](https://oj.leetcode.com/problems/sum-root-to-leaf-numbers/)| [C++](./src/sumRootToLeafNumber/sumRootToLeafNumber.cpp)|Medium| -|128|[Longest Consecutive Sequence](https://oj.leetcode.com/problems/longest-consecutive-sequence/)| [C++](./src/longestConsecutiveSequence/longestConsecutiveSequence.cpp)|Hard| -|127|[Word Ladder II](https://oj.leetcode.com/problems/word-ladder-ii/)| [C++](./src/wordLadder/wordLadder.II.cpp)|Hard| -|126|[Word Ladder](https://oj.leetcode.com/problems/word-ladder/)| [C++](./src/wordLadder/wordLadder.cpp)|Medium| -|125|[Valid Palindrome](https://oj.leetcode.com/problems/valid-palindrome/)| [C++](./src/validPalindrome/validPalindrome.cpp)|Easy| -|124|[Binary Tree Maximum Path Sum](https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/)| [C++](./src/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp)|Hard| -|123|[Best Time to Buy and Sell Stock III](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/)| [C++](./src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp)|Hard| -|122|[Best Time to Buy and Sell Stock II](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/)| [C++](./src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp)|Medium| -|121|[Best Time to Buy and Sell Stock](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/)| [C++](./src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp)|Medium| -|120|[Triangle](https://oj.leetcode.com/problems/triangle/)| [C++](./src/triangle/triangle.cpp)|Medium| -|119|[Pascal's Triangle II](https://oj.leetcode.com/problems/pascals-triangle-ii/)| [C++](./src/pascalTriangle/pascalTriangle.II.cpp)|Easy| -|118|[Pascal's Triangle](https://oj.leetcode.com/problems/pascals-triangle/)| [C++](./src/pascalTriangle/pascalTriangle.cpp)|Easy| -|117|[Populating Next Right Pointers in Each Node II](https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/)| [C++](./src/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp)|Hard| -|116|[Populating Next Right Pointers in Each Node](https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/)| [C++](./src/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp)|Medium| -|115|[Distinct Subsequences](https://oj.leetcode.com/problems/distinct-subsequences/)| [C++](./src/distinctSubsequences/distinctSubsequences.cpp)|Hard| -|114|[Flatten Binary Tree to Linked List](https://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/)| [C++](./src/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp)|Medium| -|113|[Path Sum II](https://oj.leetcode.com/problems/path-sum-ii/)| [C++](./src/pathSum/pathSum.II.cpp)|Medium| -|112|[Path Sum](https://oj.leetcode.com/problems/path-sum/)| [C++](./src/pathSum/pathSum.cpp)|Easy| -|111|[Minimum Depth of Binary Tree](https://oj.leetcode.com/problems/minimum-depth-of-binary-tree/)| [C++](./src/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp)|Easy| -|110|[Balanced Binary Tree](https://oj.leetcode.com/problems/balanced-binary-tree/)| [C++](./src/balancedBinaryTree/balancedBinaryTree.cpp)|Easy| -|109|[Convert Sorted List to Binary Search Tree](https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/)| [C++](./src/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp)|Medium| -|108|[Convert Sorted Array to Binary Search Tree](https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/)| [C++](./src/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp)|Medium| -|107|[Binary Tree Level Order Traversal II](https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/)| [C++](./src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp)|Easy| -|106|[Construct Binary Tree from Inorder and Postorder Traversal](https://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)| [C++](./src/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp)|Medium| -|105|[Construct Binary Tree from Preorder and Inorder Traversal](https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)| [C++](./src/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp)|Medium| -|104|[Maximum Depth of Binary Tree](https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/)| [C++](./src/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp)|Easy| -|103|[Binary Tree Zigzag Level Order Traversal](https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)| [C++](./src/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp)|Medium| -|102|[Binary Tree Level Order Traversal](https://oj.leetcode.com/problems/binary-tree-level-order-traversal/)| [C++](./src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp)|Easy| -|101|[Symmetric Tree](https://oj.leetcode.com/problems/symmetric-tree/)| [C++](./src/symmetricTree/symmetricTree.cpp)|Easy| -|100|[Same Tree](https://oj.leetcode.com/problems/same-tree/)| [C++](./src/sameTree/sameTree.cpp)|Easy| -|99|[Recover Binary Search Tree](https://oj.leetcode.com/problems/recover-binary-search-tree/)| [C++](./src/recoverBinarySearchTree/recoverBinarySearchTree.cpp)|Hard| -|98|[Validate Binary Search Tree](https://oj.leetcode.com/problems/validate-binary-search-tree/)| [C++](./src/validateBinarySearchTree/validateBinarySearchTree.cpp)|Medium| -|97|[Interleaving String](https://oj.leetcode.com/problems/interleaving-string/)| [C++](./src/interleavingString/interleavingString.cpp)|Hard| -|96|[Unique Binary Search Trees II](https://oj.leetcode.com/problems/unique-binary-search-trees-ii/)| [C++](./src/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp)|Medium| -|95|[Unique Binary Search Trees](https://oj.leetcode.com/problems/unique-binary-search-trees/)| [C++](./src/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp)|Medium| -|94|[Binary Tree Inorder Traversal](https://oj.leetcode.com/problems/binary-tree-inorder-traversal/)| [C++](./src/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp)|Medium| -|93|[Restore IP Addresses](https://oj.leetcode.com/problems/restore-ip-addresses/)| [C++](./src/restoreIPAddresses/restoreIPAddresses.cpp)|Medium| -|92|[Reverse Linked List II](https://oj.leetcode.com/problems/reverse-linked-list-ii/)| [C++](./src/reverseLinkedList/reverseLinkedList.II.cpp)|Medium| -|91|[Subsets II](https://oj.leetcode.com/problems/subsets-ii/)| [C++](./src/subsets/subsets.II.cpp)|Medium| -|90|[Decode Ways](https://oj.leetcode.com/problems/decode-ways/)| [C++](./src/decodeWays/decodeWays.cpp)|Medium| -|89|[Gray Code](https://oj.leetcode.com/problems/gray-code/)| [C++](./src/grayCode/grayCode.cpp)|Medium| -|88|[Merge Sorted Array](https://oj.leetcode.com/problems/merge-sorted-array/)| [C++](./src/mergeTwoSortedArray/mergeTwoSortedArray.cpp)|Easy| -|87|[Scramble String](https://oj.leetcode.com/problems/scramble-string/)| [C++](./src/scrambleString/scrambleString.cpp)|Hard| -|86|[Partition List](https://oj.leetcode.com/problems/partition-list/)| [C++](./src/partitionList/partitionList.cpp)|Medium| -|85|[Maximal Rectangle](https://oj.leetcode.com/problems/maximal-rectangle/)| [C++](./src/maximalRectangle/maximalRectangle.cpp)|Hard| -|84|[Largest Rectangle in Histogram](https://oj.leetcode.com/problems/largest-rectangle-in-histogram/)| [C++](./src/largestRectangleInHistogram/largestRectangleInHistogram.cpp)|Hard| -|83|[Remove Duplicates from Sorted List II](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/)| [C++](./src/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp)|Medium| -|82|[Remove Duplicates from Sorted List](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/)| [C++](./src/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp)|Easy| -|81|[Search in Rotated Sorted Array II](https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/)| [C++](./src/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp)|Medium| -|80|[Remove Duplicates from Sorted Array II](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)| [C++](./src/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp)|Medium| -|79|[Word Search](https://oj.leetcode.com/problems/word-search/)| [C++](./src/wordSearch/wordSearch.cpp)|Medium| -|78|[Subsets](https://oj.leetcode.com/problems/subsets/)| [C++](./src/subsets/subsets.cpp)|Medium| -|77|[Combinations](https://oj.leetcode.com/problems/combinations/)| [C++](./src/combinations/combinations.cpp)|Medium| -|76|[Minimum Window Substring](https://oj.leetcode.com/problems/minimum-window-substring/)| [C++](./src/minimumWindowSubstring/minimumWindowSubstring.cpp)|Hard| -|75|[Sort Colors](https://oj.leetcode.com/problems/sort-colors/)| [C++](./src/sortColors/sortColors.cpp)|Medium| -|74|[Search a 2D Matrix](https://oj.leetcode.com/problems/search-a-2d-matrix/)| [C++](./src/search2DMatrix/search2DMatrix.cpp)|Medium| -|73|[Set Matrix Zeroes](https://oj.leetcode.com/problems/set-matrix-zeroes/)| [C++](./src/setMatrixZeroes/setMatrixZeroes.cpp)|Medium| -|72|[Edit Distance](https://oj.leetcode.com/problems/edit-distance/)| [C++](./src/editDistance/editDistance.cpp)|Hard| -|71|[Simplify Path](https://oj.leetcode.com/problems/simplify-path/)| [C++](./src/simplifyPath/simplifyPath.cpp)|Medium| -|70|[Climbing Stairs](https://oj.leetcode.com/problems/climbing-stairs/)| [C++](./src/climbStairs/climbStairs.cpp)|Easy| -|69|[Sqrt(x)](https://oj.leetcode.com/problems/sqrtx/)| [C++](./src/sqrt/sqrt.cpp)|Medium| -|68|[Text Justification](https://oj.leetcode.com/problems/text-justification/)| [C++](./src/textJustification/textJustification.cpp)|Hard| -|67|[Plus One](https://oj.leetcode.com/problems/plus-one/)| [C++](./src/plusOne/plusOne.cpp)|Easy| -|66|[Valid Number](https://oj.leetcode.com/problems/valid-number/)| [C++](./src/validNumber/validNumber.cpp)|Easy| -|65|[Add Binary](https://oj.leetcode.com/problems/add-binary/)| [C++](./src/addBinary/addBinary.cpp)|Easy| -|64|[Merge Two Sorted Lists](https://oj.leetcode.com/problems/merge-two-sorted-lists/)| [C++](./src/mergeTwoSortedList/mergeTwoSortedList.cpp)|Easy| -|63|[Minimum Path Sum](https://oj.leetcode.com/problems/minimum-path-sum/)| [C++](./src/minimumPathSum/minimumPathSum.cpp)|Medium| -|62|[Unique Paths II](https://oj.leetcode.com/problems/unique-paths-ii/)| [C++](./src/uniquePaths/uniquePaths.II.cpp)|Medium| -|61|[Unique Paths](https://oj.leetcode.com/problems/unique-paths/)| [C++](./src/uniquePaths/uniquePaths.cpp)|Medium| -|60|[Rotate List](https://oj.leetcode.com/problems/rotate-list/)| [C++](./src/rotateList/rotateList.cpp)|Medium| -|59|[Permutation Sequence](https://oj.leetcode.com/problems/permutation-sequence/)| [C++](./src/permutationSequence/permutationSequence.cpp)|Medium| -|58|[Spiral Matrix II](https://oj.leetcode.com/problems/spiral-matrix-ii/)| [C++](./src/spiralMatrix/spiralMatrix.II.cpp)|Medium| -|57|[Length of Last Word](https://oj.leetcode.com/problems/length-of-last-word/)| [C++](./src/lengthOfLastWord/lengthOfLastWord.cpp)|Easy| -|56|[Insert Interval](https://oj.leetcode.com/problems/insert-interval/)| [C++](./src/insertInterval/insertInterval.cpp)|Hard| -|55|[Merge Intervals](https://oj.leetcode.com/problems/merge-intervals/)| [C++](./src/mergeIntervals/mergeIntervals.cpp)|Hard| -|54|[Jump Game](https://oj.leetcode.com/problems/jump-game/)| [C++](./src/jumpGame/jumpGame.cpp)|Medium| -|53|[Spiral Matrix](https://oj.leetcode.com/problems/spiral-matrix/)| [C++](./src/spiralMatrix/spiralMatrix.cpp)|Medium| -|52|[Maximum Subarray](https://oj.leetcode.com/problems/maximum-subarray/)| [C++](./src/maximumSubArray/maximumSubArray.cpp)|Medium| -|51|[N-Queens II](https://oj.leetcode.com/problems/n-queens-ii/)| [C++](./src/nQueens/nQueuens.II.cpp)|Hard| -|50|[N-Queens](https://oj.leetcode.com/problems/n-queens/)| [C++](./src/nQueens/nQueuens.cpp)|Hard| -|49|["Pow(x, n)"](https://oj.leetcode.com/problems/powx-n/)| [C++](./src/pow/pow.cpp)|Medium| -|48|[Anagrams](https://oj.leetcode.com/problems/anagrams/)| [C++](./src/anagrams/anagrams.cpp)|Medium| -|47|[Rotate Image](https://oj.leetcode.com/problems/rotate-image/)| [C++](./src/rotateImage/rotateImage.cpp)|Medium| -|46|[Permutations II](https://oj.leetcode.com/problems/permutations-ii/)| [C++](./src/permutations/permutations.II.cpp)|Hard| -|45|[Permutations](https://oj.leetcode.com/problems/permutations/)| [C++](./src/permutations/permutations.cpp)|Medium| -|44|[Jump Game II](https://oj.leetcode.com/problems/jump-game-ii/)| [C++](./src/jumpGame/jumpGame.II.cpp)|Hard| -|43|[Wildcard Matching](https://oj.leetcode.com/problems/wildcard-matching/)| [C++](./src/wildcardMatching/wildcardMatching.cpp)|Hard| -|42|[Multiply Strings](https://oj.leetcode.com/problems/multiply-strings/)| [C++](./src/multiplyStrings/multiplyStrings.cpp)|Medium| -|41|[Trapping Rain Water](https://oj.leetcode.com/problems/trapping-rain-water/)| [C++](./src/trappingRainWater/trappingRainWater.cpp)|Hard| -|40|[First Missing Positive](https://oj.leetcode.com/problems/first-missing-positive/)| [C++](./src/firstMissingPositive/firstMissingPositive.cpp)|Hard| -|39|[Combination Sum II](https://oj.leetcode.com/problems/combination-sum-ii/)| [C++](./src/combinationSum/combinationSum.II.cpp)|Medium| -|38|[Combination Sum](https://oj.leetcode.com/problems/combination-sum/)| [C++](./src/combinationSum/combinationSum.cpp)|Medium| -|37|[Count and Say](https://oj.leetcode.com/problems/count-and-say/)| [C++](./src/countAndSay/countAndSay.cpp)|Easy| -|36|[Sudoku Solver](https://oj.leetcode.com/problems/sudoku-solver/)| [C++](./src/sudokuSolver/sudokuSolver.cpp)|Hard| -|35|[Valid Sudoku](https://oj.leetcode.com/problems/valid-sudoku/)| [C++](./src/validSudoku/validSudoku.cpp)|Easy| -|34|[Search Insert Position](https://oj.leetcode.com/problems/search-insert-position/)| [C++](./src/searchInsertPosition/searchInsertPosition.cpp)|Medium| -|33|[Search for a Range](https://oj.leetcode.com/problems/search-for-a-range/)| [C++](./src/searchForRange/searchForRange.cpp)|Medium| -|32|[Search in Rotated Sorted Array](https://oj.leetcode.com/problems/search-in-rotated-sorted-array/)| [C++](./src/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp)|Hard| -|31|[Longest Valid Parentheses](https://oj.leetcode.com/problems/longest-valid-parentheses/)| [C++](./src/longestValidParentheses/longestValidParentheses.cpp)|Hard| -|30|[Next Permutation](https://oj.leetcode.com/problems/next-permutation/)| [C++](./src/nextPermutation/nextPermutation.cpp)|Medium| -|29|[Substring with Concatenation of All Words](https://oj.leetcode.com/problems/substring-with-concatenation-of-all-words/)| [C++](./src/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp)|Hard| -|28|[Divide Two Integers](https://oj.leetcode.com/problems/divide-two-integers/)| [C++](./src/divideTwoInt/divideTwoInt.cpp)|Medium| -|27|[Implement strStr()](https://oj.leetcode.com/problems/implement-strstr/)| [C++](./src/strStr/strStr.cpp)|Easy| -|26|[Remove Element](https://oj.leetcode.com/problems/remove-element/)| [C++](./src/removeElement/removeElement.cpp)|Easy| -|25|[Remove Duplicates from Sorted Array](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/)| [C++](./src/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp)|Easy| -|24|[Reverse Nodes in k-Group](https://oj.leetcode.com/problems/reverse-nodes-in-k-group/)| [C++](./src/reverseNodesInKGroup/reverseNodesInKGroup.cpp)|Hard| -|23|[Swap Nodes in Pairs](https://oj.leetcode.com/problems/swap-nodes-in-pairs/)| [C++](./src/swapNodesInPairs/swapNodesInPairs.cpp)|Medium| -|22|[Merge k Sorted Lists](https://oj.leetcode.com/problems/merge-k-sorted-lists/)| [C++](./src/mergeKSortedLists/mergeKSortedLists.cpp)|Hard| -|21|[Generate Parentheses](https://oj.leetcode.com/problems/generate-parentheses/)| [C++](./src/generateParentheses/generateParentheses.cpp)|Medium| -|20|[Valid Parentheses](https://oj.leetcode.com/problems/valid-parentheses/)| [C++](./src/validParentheses/validParentheses.cpp)|Easy| -|19|[Remove Nth Node From End of List](https://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/)| [C++](./src/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp)|Easy| -|18|[Letter Combinations of a Phone Number](https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/)| [C++](./src/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp)|Medium| -|17|[4Sum](https://oj.leetcode.com/problems/4sum/)| [C++](./src/4Sum/4Sum.cpp)|Medium| -|16|[3Sum Closest](https://oj.leetcode.com/problems/3sum-closest/)| [C++](./src/3SumClosest/3SumClosest.cpp)|Medium| -|15|[3Sum](https://oj.leetcode.com/problems/3sum/)| [C++](./src/3Sum/3Sum.cpp)|Medium| -|14|[Longest Common Prefix](https://oj.leetcode.com/problems/longest-common-prefix/)| [C++](./src/longestCommonPrefix/longestCommonPrefix.cpp)|Easy| -|13|[Roman to Integer](https://oj.leetcode.com/problems/roman-to-integer/)| [C++](./src/romanToInteger/romanToInteger.cpp)|Easy| -|12|[Integer to Roman](https://oj.leetcode.com/problems/integer-to-roman/)| [C++](./src/integerToRoman/integerToRoman.cpp)|Medium| -|11|[Container With Most Water](https://oj.leetcode.com/problems/container-with-most-water/)| [C++](./src/containerWithMostWater/containerWithMostWater.cpp)|Medium| -|10|[Regular Expression Matching](https://oj.leetcode.com/problems/regular-expression-matching/)| [C++](./src/regularExpressionMatching/regularExpressionMatching.cpp)|Hard| -|9|[Palindrome Number](https://oj.leetcode.com/problems/palindrome-number/)| [C++](./src/palindromeNumber/palindromeNumber.cpp)|Easy| -|8|[String to Integer (atoi)](https://oj.leetcode.com/problems/string-to-integer-atoi/)| [C++](./src/stringToIntegerAtoi/stringToIntegerAtoi.cpp)|Easy| -|7|[Reverse Integer](https://oj.leetcode.com/problems/reverse-integer/)| [C++](./src/reverseInteger/reverseInteger.cpp)|Easy| -|6|[ZigZag Conversion](https://oj.leetcode.com/problems/zigzag-conversion/)| [C++](./src/zigZagConversion/zigZagConversion.cpp)|Easy| -|5|[Longest Palindromic Substring](https://oj.leetcode.com/problems/longest-palindromic-substring/)| [C++](./src/longestPalindromicSubstring/longestPalindromicSubstring.cpp)|Medium| -|4|[Add Two Numbers](https://oj.leetcode.com/problems/add-two-numbers/)| [C++](./src/addTwoNumbers/addTwoNumbers.cpp)|Medium| -|3|[Longest Substring Without Repeating Characters](https://oj.leetcode.com/problems/longest-substring-without-repeating-characters/)| [C++](./src/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp)|Medium| -|2|[Median of Two Sorted Arrays](https://oj.leetcode.com/problems/median-of-two-sorted-arrays/)| [C++](./src/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp)|Hard| -|1|[Two Sum](https://oj.leetcode.com/problems/two-sum/)| [C++](./src/twoSum/twoSum.cpp)|Medium| +|181|[Number of 1 Bits](https://oj.leetcode.com/problems/number-of-1-bits/)| [C++](./algorithms/numberOf1Bits/numberOf1Bits.cpp)|Easy| +|180|[Reverse Bits](https://oj.leetcode.com/problems/reverse-bits/)| [C++](./algorithms/reverseBits/reverseBits.cpp)|Easy| +|179|[Rotate Array](https://oj.leetcode.com/problems/rotate-array/)| [C++](./algorithms/rotateArray/rotateArray.cpp)|Easy| +|178|[Best Time to Buy and Sell Stock IV](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/)| [C++](./algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp)|Hard| +|177|[Repeated DNA Sequences](https://oj.leetcode.com/problems/repeated-dna-sequences/)| [C++](./algorithms/repeatedDNASequences/repeatedDNASequences.cpp)|Medium| +|176|[Reverse Words in a String II](https://oj.leetcode.com/problems/reverse-words-in-a-string-ii/) ♥ | [C++](./algorithms/reverseWordsInAString/reverseWordsInAString.II.cpp)|Medium| +|175|[Largest Number](https://oj.leetcode.com/problems/largest-number/) | [C++](./algorithms/largestNumber/largestNumber.cpp)|Medium| +|174|[Dungeon Game](https://oj.leetcode.com/problems/dungeon-game/) | [C++](./algorithms/dungeonGame/dungeonGame.cpp)|Hard| +|173|[Binary Search Tree Iterator](https://oj.leetcode.com/problems/binary-search-tree-iterator/) | [C++](./algorithms/binarySearchTreeIterator/binarySearchTreeIterator.cpp)|Medium| +|172|[Factorial Trailing Zeroes](https://oj.leetcode.com/problems/factorial-trailing-zeroes/) | [C++](./algorithms/factorialTrailingZeroes/factorialTrailingZeroes.cpp)|Easy| +|171|[Excel Sheet Column Number](https://oj.leetcode.com/problems/excel-sheet-column-number/) | [C++](./algorithms/excelSheetColumnNumber/excelSheetColumnNumber.cpp)|Easy| +|170|[Two Sum III - Data structure design](https://oj.leetcode.com/problems/two-sum-iii-data-structure-design/) ♥ | [C++](./algorithms/twoSum/twoSum.III.cpp)|Easy| +|169|[Majority Element](https://oj.leetcode.com/problems/majority-element/) | [C++](./algorithms/majorityElement/majorityElement.cpp)|Easy| +|168|[Excel Sheet Column Title](https://oj.leetcode.com/problems/excel-sheet-column-title/) | [C++](./algorithms/excelSheetColumnTitle/excelSheetColumnTitle.cpp)|Easy| +|167|[Two Sum II - Input array is sorted](https://oj.leetcode.com/problems/two-sum-ii-input-array-is-sorted/) ♥ | [C++](./algorithms/twoSum/twoSum.II.cpp)|Medium| +|166|[Fraction to Recurring Decimal](https://oj.leetcode.com/problems/fraction-to-recurring-decimal/) | [C++](./algorithms/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp)|Medium| +|165|[Compare Version Numbers](https://oj.leetcode.com/problems/compare-version-numbers/) | [C++](./algorithms/compareVersionNumbers/compareVersionNumbers.cpp)|Easy| +|164|[Maximum Gap](https://oj.leetcode.com/problems/maximum-gap/) | [C++](./algorithms/maximumGap/maximumGap.cpp)|Hard| +|163|[Missing Ranges](https://oj.leetcode.com/problems/missing-ranges/) ♥ | [C++](./algorithms/missingRanges/missingRanges.cpp)|Medium| +|162|[Find Peak Element](https://oj.leetcode.com/problems/find-peak-element/) | [C++](./algorithms/findPeakElement/findPeakElement.cpp)|Medium| +|161|[One Edit Distance](https://oj.leetcode.com/problems/one-edit-distance/)♥ | [C++](./algorithms/oneEditDistance/oneEditDistance.cpp)|Medium| +|160|[Intersection of Two Linked Lists](https://oj.leetcode.com/problems/intersection-of-two-linked-lists/) | [C++](./algorithms/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp)|Easy| +|159|[Longest Substring with At Most Two Distinct Characters](https://oj.leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/) ♥ | [C++](./algorithms/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp)|Hard| +|158|[Read N Characters Given Read4 II - Call multiple times](https://oj.leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times/) ♥ | [C++](./algorithms/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp)|Hard| +|157|[Read N Characters Given Read4](https://oj.leetcode.com/problems/read-n-characters-given-read4/) ♥ | [C++](./algorithms/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp)|Easy| +|156|[Binary Tree Upside Down](https://oj.leetcode.com/problems/binary-tree-upside-down/) ♥ | [C++](./algorithms/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp)|Medium| +|155|[Min Stack](https://oj.leetcode.com/problems/min-stack/)| [C++](./algorithms/minStack/minStack.cpp)|Easy| +|154|[Find Minimum in Rotated Sorted Array II](https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)| [C++](./algorithms/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp)|Hard| +|153|[Find Minimum in Rotated Sorted Array](https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/)| [C++](./algorithms/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp)|Medium| +|152|[Maximum Product Subarray](https://oj.leetcode.com/problems/maximum-product-subarray/)| [C++](./algorithms/maximumProductSubarray/maximumProductSubarray.cpp)|Medium| +|151|[Reverse Words in a String](https://oj.leetcode.com/problems/reverse-words-in-a-string/)| [C++](./algorithms/reverseWordsInAString/reverseWordsInAString.cpp)|Medium| +|150|[Evaluate Reverse Polish Notation](https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/)| [C++](./algorithms/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp)|Medium| +|149|[Max Points on a Line](https://oj.leetcode.com/problems/max-points-on-a-line/)| [C++](./algorithms/maxPointsOnALine/maxPointsOnALine.cpp)|Hard| +|148|[Sort List](https://oj.leetcode.com/problems/sort-list/)| [C++](./algorithms/sortList/sortList.cpp)|Medium| +|147|[Insertion Sort List](https://oj.leetcode.com/problems/insertion-sort-list/)| [C++](./algorithms/insertionSortList/insertionSortList.cpp)|Medium| +|146|[LRU Cache](https://oj.leetcode.com/problems/lru-cache/)| [C++](./algorithms/LRUCache/LRUCache.cpp)|Hard| +|145|[Binary Tree Postorder Traversal](https://oj.leetcode.com/problems/binary-tree-postorder-traversal/)| [C++](./algorithms/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp)|Hard| +|144|[Binary Tree Preorder Traversal](https://oj.leetcode.com/problems/binary-tree-preorder-traversal/)| [C++](./algorithms/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp)|Medium| +|143|[Reorder List](https://oj.leetcode.com/problems/reorder-list/)| [C++](./algorithms/reorderList/reorderList.cpp)|Medium| +|142|[Linked List Cycle II](https://oj.leetcode.com/problems/linked-list-cycle-ii/)| [C++](./algorithms/linkedListCycle/linkedListCycle.II.cpp)|Medium| +|141|[Linked List Cycle](https://oj.leetcode.com/problems/linked-list-cycle/)| [C++](./algorithms/linkedListCycle/linkedListCycle.cpp)|Medium| +|140|[Word Break II](https://oj.leetcode.com/problems/word-break-ii/)| [C++](./algorithms/wordBreak/wordBreak.II.cpp)|Hard| +|139|[Word Break](https://oj.leetcode.com/problems/word-break/)| [C++](./algorithms/wordBreak/wordBreak.cpp)|Medium| +|138|[Copy List with Random Pointer](https://oj.leetcode.com/problems/copy-list-with-random-pointer/)| [C++](./algorithms/copyListWithRandomPointer/copyListWithRandomPointer.cpp)|Hard| +|137|[Single Number II](https://oj.leetcode.com/problems/single-number-ii/)| [C++](./algorithms/singleNumber/singleNumber.II.cpp)|Medium| +|136|[Single Number](https://oj.leetcode.com/problems/single-number/)| [C++](./algorithms/singleNumber/singleNumber.cpp)|Medium| +|135|[Candy](https://oj.leetcode.com/problems/candy/)| [C++](./algorithms/candy/candy.cpp)|Hard| +|134|[Gas Station](https://oj.leetcode.com/problems/gas-station/)| [C++](./algorithms/gasStation/gasStation.cpp)|Medium| +|133|[Clone Graph](https://oj.leetcode.com/problems/clone-graph/)| [C++](./algorithms/cloneGraph/cloneGraph.cpp)|Medium| +|132|[Palindrome Partitioning II](https://oj.leetcode.com/problems/palindrome-partitioning-ii/)| [C++](./algorithms/palindromePartitioning/palindromePartitioning.II.cpp)|Hard| +|131|[Palindrome Partitioning](https://oj.leetcode.com/problems/palindrome-partitioning/)| [C++](./algorithms/palindromePartitioning/palindromePartitioning.cpp)|Medium| +|130|[Surrounded Regions](https://oj.leetcode.com/problems/surrounded-regions/)| [C++](./algorithms/surroundedRegions/surroundedRegions.cpp)|Medium| +|129|[Sum Root to Leaf Numbers](https://oj.leetcode.com/problems/sum-root-to-leaf-numbers/)| [C++](./algorithms/sumRootToLeafNumber/sumRootToLeafNumber.cpp)|Medium| +|128|[Longest Consecutive Sequence](https://oj.leetcode.com/problems/longest-consecutive-sequence/)| [C++](./algorithms/longestConsecutiveSequence/longestConsecutiveSequence.cpp)|Hard| +|127|[Word Ladder II](https://oj.leetcode.com/problems/word-ladder-ii/)| [C++](./algorithms/wordLadder/wordLadder.II.cpp)|Hard| +|126|[Word Ladder](https://oj.leetcode.com/problems/word-ladder/)| [C++](./algorithms/wordLadder/wordLadder.cpp)|Medium| +|125|[Valid Palindrome](https://oj.leetcode.com/problems/valid-palindrome/)| [C++](./algorithms/validPalindrome/validPalindrome.cpp)|Easy| +|124|[Binary Tree Maximum Path Sum](https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/)| [C++](./algorithms/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp)|Hard| +|123|[Best Time to Buy and Sell Stock III](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/)| [C++](./algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp)|Hard| +|122|[Best Time to Buy and Sell Stock II](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/)| [C++](./algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp)|Medium| +|121|[Best Time to Buy and Sell Stock](https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/)| [C++](./algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp)|Medium| +|120|[Triangle](https://oj.leetcode.com/problems/triangle/)| [C++](./algorithms/triangle/triangle.cpp)|Medium| +|119|[Pascal's Triangle II](https://oj.leetcode.com/problems/pascals-triangle-ii/)| [C++](./algorithms/pascalTriangle/pascalTriangle.II.cpp)|Easy| +|118|[Pascal's Triangle](https://oj.leetcode.com/problems/pascals-triangle/)| [C++](./algorithms/pascalTriangle/pascalTriangle.cpp)|Easy| +|117|[Populating Next Right Pointers in Each Node II](https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/)| [C++](./algorithms/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp)|Hard| +|116|[Populating Next Right Pointers in Each Node](https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/)| [C++](./algorithms/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp)|Medium| +|115|[Distinct Subsequences](https://oj.leetcode.com/problems/distinct-subsequences/)| [C++](./algorithms/distinctSubsequences/distinctSubsequences.cpp)|Hard| +|114|[Flatten Binary Tree to Linked List](https://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/)| [C++](./algorithms/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp)|Medium| +|113|[Path Sum II](https://oj.leetcode.com/problems/path-sum-ii/)| [C++](./algorithms/pathSum/pathSum.II.cpp)|Medium| +|112|[Path Sum](https://oj.leetcode.com/problems/path-sum/)| [C++](./algorithms/pathSum/pathSum.cpp)|Easy| +|111|[Minimum Depth of Binary Tree](https://oj.leetcode.com/problems/minimum-depth-of-binary-tree/)| [C++](./algorithms/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp)|Easy| +|110|[Balanced Binary Tree](https://oj.leetcode.com/problems/balanced-binary-tree/)| [C++](./algorithms/balancedBinaryTree/balancedBinaryTree.cpp)|Easy| +|109|[Convert Sorted List to Binary Search Tree](https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/)| [C++](./algorithms/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp)|Medium| +|108|[Convert Sorted Array to Binary Search Tree](https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/)| [C++](./algorithms/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp)|Medium| +|107|[Binary Tree Level Order Traversal II](https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/)| [C++](./algorithms/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp)|Easy| +|106|[Construct Binary Tree from Inorder and Postorder Traversal](https://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)| [C++](./algorithms/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp)|Medium| +|105|[Construct Binary Tree from Preorder and Inorder Traversal](https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)| [C++](./algorithms/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp)|Medium| +|104|[Maximum Depth of Binary Tree](https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/)| [C++](./algorithms/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp)|Easy| +|103|[Binary Tree Zigzag Level Order Traversal](https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)| [C++](./algorithms/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp)|Medium| +|102|[Binary Tree Level Order Traversal](https://oj.leetcode.com/problems/binary-tree-level-order-traversal/)| [C++](./algorithms/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp)|Easy| +|101|[Symmetric Tree](https://oj.leetcode.com/problems/symmetric-tree/)| [C++](./algorithms/symmetricTree/symmetricTree.cpp)|Easy| +|100|[Same Tree](https://oj.leetcode.com/problems/same-tree/)| [C++](./algorithms/sameTree/sameTree.cpp)|Easy| +|99|[Recover Binary Search Tree](https://oj.leetcode.com/problems/recover-binary-search-tree/)| [C++](./algorithms/recoverBinarySearchTree/recoverBinarySearchTree.cpp)|Hard| +|98|[Validate Binary Search Tree](https://oj.leetcode.com/problems/validate-binary-search-tree/)| [C++](./algorithms/validateBinarySearchTree/validateBinarySearchTree.cpp)|Medium| +|97|[Interleaving String](https://oj.leetcode.com/problems/interleaving-string/)| [C++](./algorithms/interleavingString/interleavingString.cpp)|Hard| +|96|[Unique Binary Search Trees II](https://oj.leetcode.com/problems/unique-binary-search-trees-ii/)| [C++](./algorithms/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp)|Medium| +|95|[Unique Binary Search Trees](https://oj.leetcode.com/problems/unique-binary-search-trees/)| [C++](./algorithms/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp)|Medium| +|94|[Binary Tree Inorder Traversal](https://oj.leetcode.com/problems/binary-tree-inorder-traversal/)| [C++](./algorithms/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp)|Medium| +|93|[Restore IP Addresses](https://oj.leetcode.com/problems/restore-ip-addresses/)| [C++](./algorithms/restoreIPAddresses/restoreIPAddresses.cpp)|Medium| +|92|[Reverse Linked List II](https://oj.leetcode.com/problems/reverse-linked-list-ii/)| [C++](./algorithms/reverseLinkedList/reverseLinkedList.II.cpp)|Medium| +|91|[Subsets II](https://oj.leetcode.com/problems/subsets-ii/)| [C++](./algorithms/subsets/subsets.II.cpp)|Medium| +|90|[Decode Ways](https://oj.leetcode.com/problems/decode-ways/)| [C++](./algorithms/decodeWays/decodeWays.cpp)|Medium| +|89|[Gray Code](https://oj.leetcode.com/problems/gray-code/)| [C++](./algorithms/grayCode/grayCode.cpp)|Medium| +|88|[Merge Sorted Array](https://oj.leetcode.com/problems/merge-sorted-array/)| [C++](./algorithms/mergeTwoSortedArray/mergeTwoSortedArray.cpp)|Easy| +|87|[Scramble String](https://oj.leetcode.com/problems/scramble-string/)| [C++](./algorithms/scrambleString/scrambleString.cpp)|Hard| +|86|[Partition List](https://oj.leetcode.com/problems/partition-list/)| [C++](./algorithms/partitionList/partitionList.cpp)|Medium| +|85|[Maximal Rectangle](https://oj.leetcode.com/problems/maximal-rectangle/)| [C++](./algorithms/maximalRectangle/maximalRectangle.cpp)|Hard| +|84|[Largest Rectangle in Histogram](https://oj.leetcode.com/problems/largest-rectangle-in-histogram/)| [C++](./algorithms/largestRectangleInHistogram/largestRectangleInHistogram.cpp)|Hard| +|83|[Remove Duplicates from Sorted List II](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/)| [C++](./algorithms/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp)|Medium| +|82|[Remove Duplicates from Sorted List](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/)| [C++](./algorithms/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp)|Easy| +|81|[Search in Rotated Sorted Array II](https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/)| [C++](./algorithms/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp)|Medium| +|80|[Remove Duplicates from Sorted Array II](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)| [C++](./algorithms/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp)|Medium| +|79|[Word Search](https://oj.leetcode.com/problems/word-search/)| [C++](./algorithms/wordSearch/wordSearch.cpp)|Medium| +|78|[Subsets](https://oj.leetcode.com/problems/subsets/)| [C++](./algorithms/subsets/subsets.cpp)|Medium| +|77|[Combinations](https://oj.leetcode.com/problems/combinations/)| [C++](./algorithms/combinations/combinations.cpp)|Medium| +|76|[Minimum Window Substring](https://oj.leetcode.com/problems/minimum-window-substring/)| [C++](./algorithms/minimumWindowSubstring/minimumWindowSubstring.cpp)|Hard| +|75|[Sort Colors](https://oj.leetcode.com/problems/sort-colors/)| [C++](./algorithms/sortColors/sortColors.cpp)|Medium| +|74|[Search a 2D Matrix](https://oj.leetcode.com/problems/search-a-2d-matrix/)| [C++](./algorithms/search2DMatrix/search2DMatrix.cpp)|Medium| +|73|[Set Matrix Zeroes](https://oj.leetcode.com/problems/set-matrix-zeroes/)| [C++](./algorithms/setMatrixZeroes/setMatrixZeroes.cpp)|Medium| +|72|[Edit Distance](https://oj.leetcode.com/problems/edit-distance/)| [C++](./algorithms/editDistance/editDistance.cpp)|Hard| +|71|[Simplify Path](https://oj.leetcode.com/problems/simplify-path/)| [C++](./algorithms/simplifyPath/simplifyPath.cpp)|Medium| +|70|[Climbing Stairs](https://oj.leetcode.com/problems/climbing-stairs/)| [C++](./algorithms/climbStairs/climbStairs.cpp)|Easy| +|69|[Sqrt(x)](https://oj.leetcode.com/problems/sqrtx/)| [C++](./algorithms/sqrt/sqrt.cpp)|Medium| +|68|[Text Justification](https://oj.leetcode.com/problems/text-justification/)| [C++](./algorithms/textJustification/textJustification.cpp)|Hard| +|67|[Plus One](https://oj.leetcode.com/problems/plus-one/)| [C++](./algorithms/plusOne/plusOne.cpp)|Easy| +|66|[Valid Number](https://oj.leetcode.com/problems/valid-number/)| [C++](./algorithms/validNumber/validNumber.cpp)|Easy| +|65|[Add Binary](https://oj.leetcode.com/problems/add-binary/)| [C++](./algorithms/addBinary/addBinary.cpp)|Easy| +|64|[Merge Two Sorted Lists](https://oj.leetcode.com/problems/merge-two-sorted-lists/)| [C++](./algorithms/mergeTwoSortedList/mergeTwoSortedList.cpp)|Easy| +|63|[Minimum Path Sum](https://oj.leetcode.com/problems/minimum-path-sum/)| [C++](./algorithms/minimumPathSum/minimumPathSum.cpp)|Medium| +|62|[Unique Paths II](https://oj.leetcode.com/problems/unique-paths-ii/)| [C++](./algorithms/uniquePaths/uniquePaths.II.cpp)|Medium| +|61|[Unique Paths](https://oj.leetcode.com/problems/unique-paths/)| [C++](./algorithms/uniquePaths/uniquePaths.cpp)|Medium| +|60|[Rotate List](https://oj.leetcode.com/problems/rotate-list/)| [C++](./algorithms/rotateList/rotateList.cpp)|Medium| +|59|[Permutation Sequence](https://oj.leetcode.com/problems/permutation-sequence/)| [C++](./algorithms/permutationSequence/permutationSequence.cpp)|Medium| +|58|[Spiral Matrix II](https://oj.leetcode.com/problems/spiral-matrix-ii/)| [C++](./algorithms/spiralMatrix/spiralMatrix.II.cpp)|Medium| +|57|[Length of Last Word](https://oj.leetcode.com/problems/length-of-last-word/)| [C++](./algorithms/lengthOfLastWord/lengthOfLastWord.cpp)|Easy| +|56|[Insert Interval](https://oj.leetcode.com/problems/insert-interval/)| [C++](./algorithms/insertInterval/insertInterval.cpp)|Hard| +|55|[Merge Intervals](https://oj.leetcode.com/problems/merge-intervals/)| [C++](./algorithms/mergeIntervals/mergeIntervals.cpp)|Hard| +|54|[Jump Game](https://oj.leetcode.com/problems/jump-game/)| [C++](./algorithms/jumpGame/jumpGame.cpp)|Medium| +|53|[Spiral Matrix](https://oj.leetcode.com/problems/spiral-matrix/)| [C++](./algorithms/spiralMatrix/spiralMatrix.cpp)|Medium| +|52|[Maximum Subarray](https://oj.leetcode.com/problems/maximum-subarray/)| [C++](./algorithms/maximumSubArray/maximumSubArray.cpp)|Medium| +|51|[N-Queens II](https://oj.leetcode.com/problems/n-queens-ii/)| [C++](./algorithms/nQueens/nQueuens.II.cpp)|Hard| +|50|[N-Queens](https://oj.leetcode.com/problems/n-queens/)| [C++](./algorithms/nQueens/nQueuens.cpp)|Hard| +|49|["Pow(x, n)"](https://oj.leetcode.com/problems/powx-n/)| [C++](./algorithms/pow/pow.cpp)|Medium| +|48|[Anagrams](https://oj.leetcode.com/problems/anagrams/)| [C++](./algorithms/anagrams/anagrams.cpp)|Medium| +|47|[Rotate Image](https://oj.leetcode.com/problems/rotate-image/)| [C++](./algorithms/rotateImage/rotateImage.cpp)|Medium| +|46|[Permutations II](https://oj.leetcode.com/problems/permutations-ii/)| [C++](./algorithms/permutations/permutations.II.cpp)|Hard| +|45|[Permutations](https://oj.leetcode.com/problems/permutations/)| [C++](./algorithms/permutations/permutations.cpp)|Medium| +|44|[Jump Game II](https://oj.leetcode.com/problems/jump-game-ii/)| [C++](./algorithms/jumpGame/jumpGame.II.cpp)|Hard| +|43|[Wildcard Matching](https://oj.leetcode.com/problems/wildcard-matching/)| [C++](./algorithms/wildcardMatching/wildcardMatching.cpp)|Hard| +|42|[Multiply Strings](https://oj.leetcode.com/problems/multiply-strings/)| [C++](./algorithms/multiplyStrings/multiplyStrings.cpp)|Medium| +|41|[Trapping Rain Water](https://oj.leetcode.com/problems/trapping-rain-water/)| [C++](./algorithms/trappingRainWater/trappingRainWater.cpp)|Hard| +|40|[First Missing Positive](https://oj.leetcode.com/problems/first-missing-positive/)| [C++](./algorithms/firstMissingPositive/firstMissingPositive.cpp)|Hard| +|39|[Combination Sum II](https://oj.leetcode.com/problems/combination-sum-ii/)| [C++](./algorithms/combinationSum/combinationSum.II.cpp)|Medium| +|38|[Combination Sum](https://oj.leetcode.com/problems/combination-sum/)| [C++](./algorithms/combinationSum/combinationSum.cpp)|Medium| +|37|[Count and Say](https://oj.leetcode.com/problems/count-and-say/)| [C++](./algorithms/countAndSay/countAndSay.cpp)|Easy| +|36|[Sudoku Solver](https://oj.leetcode.com/problems/sudoku-solver/)| [C++](./algorithms/sudokuSolver/sudokuSolver.cpp)|Hard| +|35|[Valid Sudoku](https://oj.leetcode.com/problems/valid-sudoku/)| [C++](./algorithms/validSudoku/validSudoku.cpp)|Easy| +|34|[Search Insert Position](https://oj.leetcode.com/problems/search-insert-position/)| [C++](./algorithms/searchInsertPosition/searchInsertPosition.cpp)|Medium| +|33|[Search for a Range](https://oj.leetcode.com/problems/search-for-a-range/)| [C++](./algorithms/searchForRange/searchForRange.cpp)|Medium| +|32|[Search in Rotated Sorted Array](https://oj.leetcode.com/problems/search-in-rotated-sorted-array/)| [C++](./algorithms/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp)|Hard| +|31|[Longest Valid Parentheses](https://oj.leetcode.com/problems/longest-valid-parentheses/)| [C++](./algorithms/longestValidParentheses/longestValidParentheses.cpp)|Hard| +|30|[Next Permutation](https://oj.leetcode.com/problems/next-permutation/)| [C++](./algorithms/nextPermutation/nextPermutation.cpp)|Medium| +|29|[Substring with Concatenation of All Words](https://oj.leetcode.com/problems/substring-with-concatenation-of-all-words/)| [C++](./algorithms/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp)|Hard| +|28|[Divide Two Integers](https://oj.leetcode.com/problems/divide-two-integers/)| [C++](./algorithms/divideTwoInt/divideTwoInt.cpp)|Medium| +|27|[Implement strStr()](https://oj.leetcode.com/problems/implement-strstr/)| [C++](./algorithms/strStr/strStr.cpp)|Easy| +|26|[Remove Element](https://oj.leetcode.com/problems/remove-element/)| [C++](./algorithms/removeElement/removeElement.cpp)|Easy| +|25|[Remove Duplicates from Sorted Array](https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/)| [C++](./algorithms/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp)|Easy| +|24|[Reverse Nodes in k-Group](https://oj.leetcode.com/problems/reverse-nodes-in-k-group/)| [C++](./algorithms/reverseNodesInKGroup/reverseNodesInKGroup.cpp)|Hard| +|23|[Swap Nodes in Pairs](https://oj.leetcode.com/problems/swap-nodes-in-pairs/)| [C++](./algorithms/swapNodesInPairs/swapNodesInPairs.cpp)|Medium| +|22|[Merge k Sorted Lists](https://oj.leetcode.com/problems/merge-k-sorted-lists/)| [C++](./algorithms/mergeKSortedLists/mergeKSortedLists.cpp)|Hard| +|21|[Generate Parentheses](https://oj.leetcode.com/problems/generate-parentheses/)| [C++](./algorithms/generateParentheses/generateParentheses.cpp)|Medium| +|20|[Valid Parentheses](https://oj.leetcode.com/problems/valid-parentheses/)| [C++](./algorithms/validParentheses/validParentheses.cpp)|Easy| +|19|[Remove Nth Node From End of List](https://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/)| [C++](./algorithms/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp)|Easy| +|18|[Letter Combinations of a Phone Number](https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/)| [C++](./algorithms/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp)|Medium| +|17|[4Sum](https://oj.leetcode.com/problems/4sum/)| [C++](./algorithms/4Sum/4Sum.cpp)|Medium| +|16|[3Sum Closest](https://oj.leetcode.com/problems/3sum-closest/)| [C++](./algorithms/3SumClosest/3SumClosest.cpp)|Medium| +|15|[3Sum](https://oj.leetcode.com/problems/3sum/)| [C++](./algorithms/3Sum/3Sum.cpp)|Medium| +|14|[Longest Common Prefix](https://oj.leetcode.com/problems/longest-common-prefix/)| [C++](./algorithms/longestCommonPrefix/longestCommonPrefix.cpp)|Easy| +|13|[Roman to Integer](https://oj.leetcode.com/problems/roman-to-integer/)| [C++](./algorithms/romanToInteger/romanToInteger.cpp)|Easy| +|12|[Integer to Roman](https://oj.leetcode.com/problems/integer-to-roman/)| [C++](./algorithms/integerToRoman/integerToRoman.cpp)|Medium| +|11|[Container With Most Water](https://oj.leetcode.com/problems/container-with-most-water/)| [C++](./algorithms/containerWithMostWater/containerWithMostWater.cpp)|Medium| +|10|[Regular Expression Matching](https://oj.leetcode.com/problems/regular-expression-matching/)| [C++](./algorithms/regularExpressionMatching/regularExpressionMatching.cpp)|Hard| +|9|[Palindrome Number](https://oj.leetcode.com/problems/palindrome-number/)| [C++](./algorithms/palindromeNumber/palindromeNumber.cpp)|Easy| +|8|[String to Integer (atoi)](https://oj.leetcode.com/problems/string-to-integer-atoi/)| [C++](./algorithms/stringToIntegerAtoi/stringToIntegerAtoi.cpp)|Easy| +|7|[Reverse Integer](https://oj.leetcode.com/problems/reverse-integer/)| [C++](./algorithms/reverseInteger/reverseInteger.cpp)|Easy| +|6|[ZigZag Conversion](https://oj.leetcode.com/problems/zigzag-conversion/)| [C++](./algorithms/zigZagConversion/zigZagConversion.cpp)|Easy| +|5|[Longest Palindromic Substring](https://oj.leetcode.com/problems/longest-palindromic-substring/)| [C++](./algorithms/longestPalindromicSubstring/longestPalindromicSubstring.cpp)|Medium| +|4|[Add Two Numbers](https://oj.leetcode.com/problems/add-two-numbers/)| [C++](./algorithms/addTwoNumbers/addTwoNumbers.cpp)|Medium| +|3|[Longest Substring Without Repeating Characters](https://oj.leetcode.com/problems/longest-substring-without-repeating-characters/)| [C++](./algorithms/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp)|Medium| +|2|[Median of Two Sorted Arrays](https://oj.leetcode.com/problems/median-of-two-sorted-arrays/)| [C++](./algorithms/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp)|Hard| +|1|[Two Sum](https://oj.leetcode.com/problems/two-sum/)| [C++](./algorithms/twoSum/twoSum.cpp)|Medium| + + + + +###LeetCode Shell + + +| # | Title | Solution | Difficulty | +|---| ----- | -------- | ---------- | +|4|[Tenth Line](https://leetcode.com/problems/tenth-line/)| [Bash](./shell/TenthLine.sh)|Easy| +|3|[Transpose File](https://leetcode.com/problems/transpose-file/)| [Bash](./shell/TransposeFile.sh)|Medium| +|2|[Valid Phone Numbers](https://leetcode.com/problems/valid-phone-numbers/)| [Bash](./shell/ValidPhoneNumbers.sh)|Easy| +|1|[Word Frequency](https://leetcode.com/problems/word-frequency/)| [Bash](./shell/WordFrequency.sh)|Medium| + diff --git a/src/3Sum/3Sum.cpp b/algorithms/3Sum/3Sum.cpp similarity index 100% rename from src/3Sum/3Sum.cpp rename to algorithms/3Sum/3Sum.cpp diff --git a/src/3SumClosest/3SumClosest.cpp b/algorithms/3SumClosest/3SumClosest.cpp similarity index 100% rename from src/3SumClosest/3SumClosest.cpp rename to algorithms/3SumClosest/3SumClosest.cpp diff --git a/src/4Sum/4Sum.cpp b/algorithms/4Sum/4Sum.cpp similarity index 100% rename from src/4Sum/4Sum.cpp rename to algorithms/4Sum/4Sum.cpp diff --git a/src/LRUCache/LRUCache.cpp b/algorithms/LRUCache/LRUCache.cpp similarity index 100% rename from src/LRUCache/LRUCache.cpp rename to algorithms/LRUCache/LRUCache.cpp diff --git a/src/addBinary/addBinary.cpp b/algorithms/addBinary/addBinary.cpp similarity index 100% rename from src/addBinary/addBinary.cpp rename to algorithms/addBinary/addBinary.cpp diff --git a/src/addTwoNumbers/addTwoNumbers.cpp b/algorithms/addTwoNumbers/addTwoNumbers.cpp similarity index 100% rename from src/addTwoNumbers/addTwoNumbers.cpp rename to algorithms/addTwoNumbers/addTwoNumbers.cpp diff --git a/src/anagrams/anagrams.cpp b/algorithms/anagrams/anagrams.cpp similarity index 100% rename from src/anagrams/anagrams.cpp rename to algorithms/anagrams/anagrams.cpp diff --git a/src/balancedBinaryTree/balancedBinaryTree.cpp b/algorithms/balancedBinaryTree/balancedBinaryTree.cpp similarity index 100% rename from src/balancedBinaryTree/balancedBinaryTree.cpp rename to algorithms/balancedBinaryTree/balancedBinaryTree.cpp diff --git a/src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp b/algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp similarity index 100% rename from src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp rename to algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp diff --git a/src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp b/algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp similarity index 100% rename from src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp rename to algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp diff --git a/src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp b/algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp similarity index 100% rename from src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp rename to algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp diff --git a/src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp b/algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp similarity index 100% rename from src/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp rename to algorithms/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp diff --git a/src/binarySearchTreeIterator/binarySearchTreeIterator.cpp b/algorithms/binarySearchTreeIterator/binarySearchTreeIterator.cpp similarity index 100% rename from src/binarySearchTreeIterator/binarySearchTreeIterator.cpp rename to algorithms/binarySearchTreeIterator/binarySearchTreeIterator.cpp diff --git a/src/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp b/algorithms/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp similarity index 100% rename from src/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp rename to algorithms/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp diff --git a/src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp b/algorithms/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp similarity index 100% rename from src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp rename to algorithms/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp diff --git a/src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp b/algorithms/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp similarity index 100% rename from src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp rename to algorithms/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp diff --git a/src/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp b/algorithms/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp similarity index 100% rename from src/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp rename to algorithms/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp diff --git a/src/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp b/algorithms/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp similarity index 100% rename from src/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp rename to algorithms/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp diff --git a/src/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp b/algorithms/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp similarity index 100% rename from src/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp rename to algorithms/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp diff --git a/src/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp b/algorithms/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp similarity index 100% rename from src/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp rename to algorithms/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp diff --git a/src/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp b/algorithms/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp similarity index 100% rename from src/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp rename to algorithms/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp diff --git a/src/candy/candy.cpp b/algorithms/candy/candy.cpp similarity index 100% rename from src/candy/candy.cpp rename to algorithms/candy/candy.cpp diff --git a/src/climbStairs/climbStairs.cpp b/algorithms/climbStairs/climbStairs.cpp similarity index 100% rename from src/climbStairs/climbStairs.cpp rename to algorithms/climbStairs/climbStairs.cpp diff --git a/src/cloneGraph/cloneGraph.cpp b/algorithms/cloneGraph/cloneGraph.cpp similarity index 100% rename from src/cloneGraph/cloneGraph.cpp rename to algorithms/cloneGraph/cloneGraph.cpp diff --git a/src/combinationSum/combinationSum.II.cpp b/algorithms/combinationSum/combinationSum.II.cpp similarity index 100% rename from src/combinationSum/combinationSum.II.cpp rename to algorithms/combinationSum/combinationSum.II.cpp diff --git a/src/combinationSum/combinationSum.cpp b/algorithms/combinationSum/combinationSum.cpp similarity index 100% rename from src/combinationSum/combinationSum.cpp rename to algorithms/combinationSum/combinationSum.cpp diff --git a/src/combinations/combinations.cpp b/algorithms/combinations/combinations.cpp similarity index 100% rename from src/combinations/combinations.cpp rename to algorithms/combinations/combinations.cpp diff --git a/src/compareVersionNumbers/compareVersionNumbers.cpp b/algorithms/compareVersionNumbers/compareVersionNumbers.cpp similarity index 100% rename from src/compareVersionNumbers/compareVersionNumbers.cpp rename to algorithms/compareVersionNumbers/compareVersionNumbers.cpp diff --git a/src/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp b/algorithms/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp similarity index 100% rename from src/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp rename to algorithms/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp diff --git a/src/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp b/algorithms/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp similarity index 100% rename from src/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp rename to algorithms/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp diff --git a/src/containerWithMostWater/containerWithMostWater.cpp b/algorithms/containerWithMostWater/containerWithMostWater.cpp similarity index 100% rename from src/containerWithMostWater/containerWithMostWater.cpp rename to algorithms/containerWithMostWater/containerWithMostWater.cpp diff --git a/src/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp b/algorithms/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp similarity index 100% rename from src/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp rename to algorithms/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp diff --git a/src/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp b/algorithms/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp similarity index 100% rename from src/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp rename to algorithms/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp diff --git a/src/copyListWithRandomPointer/copyListWithRandomPointer.cpp b/algorithms/copyListWithRandomPointer/copyListWithRandomPointer.cpp similarity index 100% rename from src/copyListWithRandomPointer/copyListWithRandomPointer.cpp rename to algorithms/copyListWithRandomPointer/copyListWithRandomPointer.cpp diff --git a/src/countAndSay/countAndSay.cpp b/algorithms/countAndSay/countAndSay.cpp similarity index 100% rename from src/countAndSay/countAndSay.cpp rename to algorithms/countAndSay/countAndSay.cpp diff --git a/src/decodeWays/decodeWays.cpp b/algorithms/decodeWays/decodeWays.cpp similarity index 100% rename from src/decodeWays/decodeWays.cpp rename to algorithms/decodeWays/decodeWays.cpp diff --git a/src/distinctSubsequences/distinctSubsequences.cpp b/algorithms/distinctSubsequences/distinctSubsequences.cpp similarity index 100% rename from src/distinctSubsequences/distinctSubsequences.cpp rename to algorithms/distinctSubsequences/distinctSubsequences.cpp diff --git a/src/divideTwoInt/divideTwoInt.cpp b/algorithms/divideTwoInt/divideTwoInt.cpp similarity index 100% rename from src/divideTwoInt/divideTwoInt.cpp rename to algorithms/divideTwoInt/divideTwoInt.cpp diff --git a/src/dungeonGame/dungeonGame.cpp b/algorithms/dungeonGame/dungeonGame.cpp similarity index 100% rename from src/dungeonGame/dungeonGame.cpp rename to algorithms/dungeonGame/dungeonGame.cpp diff --git a/src/editDistance/editDistance.cpp b/algorithms/editDistance/editDistance.cpp similarity index 100% rename from src/editDistance/editDistance.cpp rename to algorithms/editDistance/editDistance.cpp diff --git a/src/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp b/algorithms/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp similarity index 100% rename from src/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp rename to algorithms/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp diff --git a/src/excelSheetColumnNumber/excelSheetColumnNumber.cpp b/algorithms/excelSheetColumnNumber/excelSheetColumnNumber.cpp similarity index 100% rename from src/excelSheetColumnNumber/excelSheetColumnNumber.cpp rename to algorithms/excelSheetColumnNumber/excelSheetColumnNumber.cpp diff --git a/src/excelSheetColumnTitle/excelSheetColumnTitle.cpp b/algorithms/excelSheetColumnTitle/excelSheetColumnTitle.cpp similarity index 100% rename from src/excelSheetColumnTitle/excelSheetColumnTitle.cpp rename to algorithms/excelSheetColumnTitle/excelSheetColumnTitle.cpp diff --git a/src/factorialTrailingZeroes/factorialTrailingZeroes.cpp b/algorithms/factorialTrailingZeroes/factorialTrailingZeroes.cpp similarity index 100% rename from src/factorialTrailingZeroes/factorialTrailingZeroes.cpp rename to algorithms/factorialTrailingZeroes/factorialTrailingZeroes.cpp diff --git a/src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp b/algorithms/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp similarity index 100% rename from src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp rename to algorithms/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp diff --git a/src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp b/algorithms/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp similarity index 100% rename from src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp rename to algorithms/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp diff --git a/src/findPeakElement/findPeakElement.cpp b/algorithms/findPeakElement/findPeakElement.cpp similarity index 100% rename from src/findPeakElement/findPeakElement.cpp rename to algorithms/findPeakElement/findPeakElement.cpp diff --git a/src/firstMissingPositive/firstMissingPositive.cpp b/algorithms/firstMissingPositive/firstMissingPositive.cpp similarity index 100% rename from src/firstMissingPositive/firstMissingPositive.cpp rename to algorithms/firstMissingPositive/firstMissingPositive.cpp diff --git a/src/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp b/algorithms/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp similarity index 100% rename from src/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp rename to algorithms/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp diff --git a/src/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp b/algorithms/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp similarity index 100% rename from src/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp rename to algorithms/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp diff --git a/src/gasStation/gasStation.cpp b/algorithms/gasStation/gasStation.cpp similarity index 100% rename from src/gasStation/gasStation.cpp rename to algorithms/gasStation/gasStation.cpp diff --git a/src/generateParentheses/generateParentheses.cpp b/algorithms/generateParentheses/generateParentheses.cpp similarity index 100% rename from src/generateParentheses/generateParentheses.cpp rename to algorithms/generateParentheses/generateParentheses.cpp diff --git a/src/grayCode/grayCode.cpp b/algorithms/grayCode/grayCode.cpp similarity index 100% rename from src/grayCode/grayCode.cpp rename to algorithms/grayCode/grayCode.cpp diff --git a/src/insertInterval/insertInterval.cpp b/algorithms/insertInterval/insertInterval.cpp similarity index 100% rename from src/insertInterval/insertInterval.cpp rename to algorithms/insertInterval/insertInterval.cpp diff --git a/src/insertionSortList/insertionSortList.cpp b/algorithms/insertionSortList/insertionSortList.cpp similarity index 100% rename from src/insertionSortList/insertionSortList.cpp rename to algorithms/insertionSortList/insertionSortList.cpp diff --git a/src/integerToRoman/integerToRoman.cpp b/algorithms/integerToRoman/integerToRoman.cpp similarity index 100% rename from src/integerToRoman/integerToRoman.cpp rename to algorithms/integerToRoman/integerToRoman.cpp diff --git a/src/interleavingString/interleavingString.cpp b/algorithms/interleavingString/interleavingString.cpp similarity index 100% rename from src/interleavingString/interleavingString.cpp rename to algorithms/interleavingString/interleavingString.cpp diff --git a/src/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp b/algorithms/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp similarity index 100% rename from src/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp rename to algorithms/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp diff --git a/src/jumpGame/jumpGame.II.cpp b/algorithms/jumpGame/jumpGame.II.cpp similarity index 100% rename from src/jumpGame/jumpGame.II.cpp rename to algorithms/jumpGame/jumpGame.II.cpp diff --git a/src/jumpGame/jumpGame.cpp b/algorithms/jumpGame/jumpGame.cpp similarity index 100% rename from src/jumpGame/jumpGame.cpp rename to algorithms/jumpGame/jumpGame.cpp diff --git a/src/largestNumber/largestNumber.cpp b/algorithms/largestNumber/largestNumber.cpp similarity index 100% rename from src/largestNumber/largestNumber.cpp rename to algorithms/largestNumber/largestNumber.cpp diff --git a/src/largestRectangleInHistogram/largestRectangleInHistogram.cpp b/algorithms/largestRectangleInHistogram/largestRectangleInHistogram.cpp similarity index 100% rename from src/largestRectangleInHistogram/largestRectangleInHistogram.cpp rename to algorithms/largestRectangleInHistogram/largestRectangleInHistogram.cpp diff --git a/src/lengthOfLastWord/lengthOfLastWord.cpp b/algorithms/lengthOfLastWord/lengthOfLastWord.cpp similarity index 100% rename from src/lengthOfLastWord/lengthOfLastWord.cpp rename to algorithms/lengthOfLastWord/lengthOfLastWord.cpp diff --git a/src/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp b/algorithms/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp similarity index 100% rename from src/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp rename to algorithms/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp diff --git a/src/linkedListCycle/linkedListCycle.II.cpp b/algorithms/linkedListCycle/linkedListCycle.II.cpp similarity index 100% rename from src/linkedListCycle/linkedListCycle.II.cpp rename to algorithms/linkedListCycle/linkedListCycle.II.cpp diff --git a/src/linkedListCycle/linkedListCycle.cpp b/algorithms/linkedListCycle/linkedListCycle.cpp similarity index 100% rename from src/linkedListCycle/linkedListCycle.cpp rename to algorithms/linkedListCycle/linkedListCycle.cpp diff --git a/src/longestCommonPrefix/longestCommonPrefix.cpp b/algorithms/longestCommonPrefix/longestCommonPrefix.cpp similarity index 100% rename from src/longestCommonPrefix/longestCommonPrefix.cpp rename to algorithms/longestCommonPrefix/longestCommonPrefix.cpp diff --git a/src/longestConsecutiveSequence/longestConsecutiveSequence.cpp b/algorithms/longestConsecutiveSequence/longestConsecutiveSequence.cpp similarity index 100% rename from src/longestConsecutiveSequence/longestConsecutiveSequence.cpp rename to algorithms/longestConsecutiveSequence/longestConsecutiveSequence.cpp diff --git a/src/longestPalindromicSubstring/longestPalindromicSubstring.cpp b/algorithms/longestPalindromicSubstring/longestPalindromicSubstring.cpp similarity index 100% rename from src/longestPalindromicSubstring/longestPalindromicSubstring.cpp rename to algorithms/longestPalindromicSubstring/longestPalindromicSubstring.cpp diff --git a/src/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp b/algorithms/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp similarity index 100% rename from src/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp rename to algorithms/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp diff --git a/src/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp b/algorithms/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp similarity index 100% rename from src/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp rename to algorithms/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp diff --git a/src/longestValidParentheses/longestValidParentheses.cpp b/algorithms/longestValidParentheses/longestValidParentheses.cpp similarity index 100% rename from src/longestValidParentheses/longestValidParentheses.cpp rename to algorithms/longestValidParentheses/longestValidParentheses.cpp diff --git a/src/majorityElement/majorityElement.cpp b/algorithms/majorityElement/majorityElement.cpp similarity index 100% rename from src/majorityElement/majorityElement.cpp rename to algorithms/majorityElement/majorityElement.cpp diff --git a/src/maxPointsOnALine/maxPointsOnALine.cpp b/algorithms/maxPointsOnALine/maxPointsOnALine.cpp similarity index 100% rename from src/maxPointsOnALine/maxPointsOnALine.cpp rename to algorithms/maxPointsOnALine/maxPointsOnALine.cpp diff --git a/src/maximalRectangle/maximalRectangle.cpp b/algorithms/maximalRectangle/maximalRectangle.cpp similarity index 100% rename from src/maximalRectangle/maximalRectangle.cpp rename to algorithms/maximalRectangle/maximalRectangle.cpp diff --git a/src/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp b/algorithms/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp similarity index 100% rename from src/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp rename to algorithms/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp diff --git a/src/maximumGap/maximumGap.cpp b/algorithms/maximumGap/maximumGap.cpp similarity index 100% rename from src/maximumGap/maximumGap.cpp rename to algorithms/maximumGap/maximumGap.cpp diff --git a/src/maximumProductSubarray/maximumProductSubarray.cpp b/algorithms/maximumProductSubarray/maximumProductSubarray.cpp similarity index 100% rename from src/maximumProductSubarray/maximumProductSubarray.cpp rename to algorithms/maximumProductSubarray/maximumProductSubarray.cpp diff --git a/src/maximumSubArray/maximumSubArray.cpp b/algorithms/maximumSubArray/maximumSubArray.cpp similarity index 100% rename from src/maximumSubArray/maximumSubArray.cpp rename to algorithms/maximumSubArray/maximumSubArray.cpp diff --git a/src/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp b/algorithms/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp similarity index 100% rename from src/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp rename to algorithms/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp diff --git a/src/mergeIntervals/mergeIntervals.cpp b/algorithms/mergeIntervals/mergeIntervals.cpp similarity index 100% rename from src/mergeIntervals/mergeIntervals.cpp rename to algorithms/mergeIntervals/mergeIntervals.cpp diff --git a/src/mergeKSortedLists/mergeKSortedLists.cpp b/algorithms/mergeKSortedLists/mergeKSortedLists.cpp similarity index 100% rename from src/mergeKSortedLists/mergeKSortedLists.cpp rename to algorithms/mergeKSortedLists/mergeKSortedLists.cpp diff --git a/src/mergeTwoSortedArray/mergeTwoSortedArray.cpp b/algorithms/mergeTwoSortedArray/mergeTwoSortedArray.cpp similarity index 100% rename from src/mergeTwoSortedArray/mergeTwoSortedArray.cpp rename to algorithms/mergeTwoSortedArray/mergeTwoSortedArray.cpp diff --git a/src/mergeTwoSortedList/mergeTwoSortedList.cpp b/algorithms/mergeTwoSortedList/mergeTwoSortedList.cpp similarity index 100% rename from src/mergeTwoSortedList/mergeTwoSortedList.cpp rename to algorithms/mergeTwoSortedList/mergeTwoSortedList.cpp diff --git a/src/minStack/minStack.cpp b/algorithms/minStack/minStack.cpp similarity index 100% rename from src/minStack/minStack.cpp rename to algorithms/minStack/minStack.cpp diff --git a/src/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp b/algorithms/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp similarity index 100% rename from src/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp rename to algorithms/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp diff --git a/src/minimumPathSum/minimumPathSum.cpp b/algorithms/minimumPathSum/minimumPathSum.cpp similarity index 100% rename from src/minimumPathSum/minimumPathSum.cpp rename to algorithms/minimumPathSum/minimumPathSum.cpp diff --git a/src/minimumWindowSubstring/minimumWindowSubstring.cpp b/algorithms/minimumWindowSubstring/minimumWindowSubstring.cpp similarity index 100% rename from src/minimumWindowSubstring/minimumWindowSubstring.cpp rename to algorithms/minimumWindowSubstring/minimumWindowSubstring.cpp diff --git a/src/missingRanges/missingRanges.cpp b/algorithms/missingRanges/missingRanges.cpp similarity index 100% rename from src/missingRanges/missingRanges.cpp rename to algorithms/missingRanges/missingRanges.cpp diff --git a/src/multiplyStrings/multiplyStrings.cpp b/algorithms/multiplyStrings/multiplyStrings.cpp similarity index 100% rename from src/multiplyStrings/multiplyStrings.cpp rename to algorithms/multiplyStrings/multiplyStrings.cpp diff --git a/src/nQueens/nQueuens.II.cpp b/algorithms/nQueens/nQueuens.II.cpp similarity index 100% rename from src/nQueens/nQueuens.II.cpp rename to algorithms/nQueens/nQueuens.II.cpp diff --git a/src/nQueens/nQueuens.cpp b/algorithms/nQueens/nQueuens.cpp similarity index 100% rename from src/nQueens/nQueuens.cpp rename to algorithms/nQueens/nQueuens.cpp diff --git a/src/nextPermutation/nextPermutation.cpp b/algorithms/nextPermutation/nextPermutation.cpp similarity index 100% rename from src/nextPermutation/nextPermutation.cpp rename to algorithms/nextPermutation/nextPermutation.cpp diff --git a/src/numberOf1Bits/numberOf1Bits.cpp b/algorithms/numberOf1Bits/numberOf1Bits.cpp similarity index 100% rename from src/numberOf1Bits/numberOf1Bits.cpp rename to algorithms/numberOf1Bits/numberOf1Bits.cpp diff --git a/src/oneEditDistance/oneEditDistance.cpp b/algorithms/oneEditDistance/oneEditDistance.cpp similarity index 100% rename from src/oneEditDistance/oneEditDistance.cpp rename to algorithms/oneEditDistance/oneEditDistance.cpp diff --git a/src/palindromeNumber/palindromeNumber.cpp b/algorithms/palindromeNumber/palindromeNumber.cpp similarity index 100% rename from src/palindromeNumber/palindromeNumber.cpp rename to algorithms/palindromeNumber/palindromeNumber.cpp diff --git a/src/palindromePartitioning/palindromePartitioning.II.cpp b/algorithms/palindromePartitioning/palindromePartitioning.II.cpp similarity index 100% rename from src/palindromePartitioning/palindromePartitioning.II.cpp rename to algorithms/palindromePartitioning/palindromePartitioning.II.cpp diff --git a/src/palindromePartitioning/palindromePartitioning.cpp b/algorithms/palindromePartitioning/palindromePartitioning.cpp similarity index 100% rename from src/palindromePartitioning/palindromePartitioning.cpp rename to algorithms/palindromePartitioning/palindromePartitioning.cpp diff --git a/src/partitionList/partitionList.cpp b/algorithms/partitionList/partitionList.cpp similarity index 100% rename from src/partitionList/partitionList.cpp rename to algorithms/partitionList/partitionList.cpp diff --git a/src/pascalTriangle/pascalTriangle.II.cpp b/algorithms/pascalTriangle/pascalTriangle.II.cpp similarity index 100% rename from src/pascalTriangle/pascalTriangle.II.cpp rename to algorithms/pascalTriangle/pascalTriangle.II.cpp diff --git a/src/pascalTriangle/pascalTriangle.cpp b/algorithms/pascalTriangle/pascalTriangle.cpp similarity index 100% rename from src/pascalTriangle/pascalTriangle.cpp rename to algorithms/pascalTriangle/pascalTriangle.cpp diff --git a/src/pathSum/pathSum.II.cpp b/algorithms/pathSum/pathSum.II.cpp similarity index 100% rename from src/pathSum/pathSum.II.cpp rename to algorithms/pathSum/pathSum.II.cpp diff --git a/src/pathSum/pathSum.cpp b/algorithms/pathSum/pathSum.cpp similarity index 100% rename from src/pathSum/pathSum.cpp rename to algorithms/pathSum/pathSum.cpp diff --git a/src/permutationSequence/permutationSequence.cpp b/algorithms/permutationSequence/permutationSequence.cpp similarity index 100% rename from src/permutationSequence/permutationSequence.cpp rename to algorithms/permutationSequence/permutationSequence.cpp diff --git a/src/permutations/permutations.II.cpp b/algorithms/permutations/permutations.II.cpp similarity index 100% rename from src/permutations/permutations.II.cpp rename to algorithms/permutations/permutations.II.cpp diff --git a/src/permutations/permutations.cpp b/algorithms/permutations/permutations.cpp similarity index 100% rename from src/permutations/permutations.cpp rename to algorithms/permutations/permutations.cpp diff --git a/src/plusOne/plusOne.cpp b/algorithms/plusOne/plusOne.cpp similarity index 100% rename from src/plusOne/plusOne.cpp rename to algorithms/plusOne/plusOne.cpp diff --git a/src/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp b/algorithms/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp similarity index 100% rename from src/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp rename to algorithms/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp diff --git a/src/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp b/algorithms/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp similarity index 100% rename from src/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp rename to algorithms/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp diff --git a/src/pow/pow.cpp b/algorithms/pow/pow.cpp similarity index 100% rename from src/pow/pow.cpp rename to algorithms/pow/pow.cpp diff --git a/src/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp b/algorithms/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp similarity index 100% rename from src/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp rename to algorithms/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp diff --git a/src/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp b/algorithms/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp similarity index 100% rename from src/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp rename to algorithms/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp diff --git a/src/recoverBinarySearchTree/recoverBinarySearchTree.cpp b/algorithms/recoverBinarySearchTree/recoverBinarySearchTree.cpp similarity index 100% rename from src/recoverBinarySearchTree/recoverBinarySearchTree.cpp rename to algorithms/recoverBinarySearchTree/recoverBinarySearchTree.cpp diff --git a/src/regularExpressionMatching/regularExpressionMatching.cpp b/algorithms/regularExpressionMatching/regularExpressionMatching.cpp similarity index 100% rename from src/regularExpressionMatching/regularExpressionMatching.cpp rename to algorithms/regularExpressionMatching/regularExpressionMatching.cpp diff --git a/src/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp b/algorithms/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp similarity index 100% rename from src/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp rename to algorithms/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp diff --git a/src/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp b/algorithms/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp similarity index 100% rename from src/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp rename to algorithms/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp diff --git a/src/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp b/algorithms/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp similarity index 100% rename from src/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp rename to algorithms/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp diff --git a/src/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp b/algorithms/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp similarity index 100% rename from src/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp rename to algorithms/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp diff --git a/src/removeElement/removeElement.cpp b/algorithms/removeElement/removeElement.cpp similarity index 100% rename from src/removeElement/removeElement.cpp rename to algorithms/removeElement/removeElement.cpp diff --git a/src/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp b/algorithms/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp similarity index 100% rename from src/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp rename to algorithms/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp diff --git a/src/reorderList/reorderList.cpp b/algorithms/reorderList/reorderList.cpp similarity index 100% rename from src/reorderList/reorderList.cpp rename to algorithms/reorderList/reorderList.cpp diff --git a/src/repeatedDNASequences/repeatedDNASequences.cpp b/algorithms/repeatedDNASequences/repeatedDNASequences.cpp similarity index 100% rename from src/repeatedDNASequences/repeatedDNASequences.cpp rename to algorithms/repeatedDNASequences/repeatedDNASequences.cpp diff --git a/src/restoreIPAddresses/restoreIPAddresses.cpp b/algorithms/restoreIPAddresses/restoreIPAddresses.cpp similarity index 100% rename from src/restoreIPAddresses/restoreIPAddresses.cpp rename to algorithms/restoreIPAddresses/restoreIPAddresses.cpp diff --git a/src/reverseBits/reverseBits.cpp b/algorithms/reverseBits/reverseBits.cpp similarity index 100% rename from src/reverseBits/reverseBits.cpp rename to algorithms/reverseBits/reverseBits.cpp diff --git a/src/reverseInteger/reverseInteger.cpp b/algorithms/reverseInteger/reverseInteger.cpp similarity index 100% rename from src/reverseInteger/reverseInteger.cpp rename to algorithms/reverseInteger/reverseInteger.cpp diff --git a/src/reverseLinkedList/reverseLinkedList.II.cpp b/algorithms/reverseLinkedList/reverseLinkedList.II.cpp similarity index 100% rename from src/reverseLinkedList/reverseLinkedList.II.cpp rename to algorithms/reverseLinkedList/reverseLinkedList.II.cpp diff --git a/src/reverseNodesInKGroup/reverseNodesInKGroup.cpp b/algorithms/reverseNodesInKGroup/reverseNodesInKGroup.cpp similarity index 100% rename from src/reverseNodesInKGroup/reverseNodesInKGroup.cpp rename to algorithms/reverseNodesInKGroup/reverseNodesInKGroup.cpp diff --git a/src/reverseWordsInAString/reverseWordsInAString.II.cpp b/algorithms/reverseWordsInAString/reverseWordsInAString.II.cpp similarity index 100% rename from src/reverseWordsInAString/reverseWordsInAString.II.cpp rename to algorithms/reverseWordsInAString/reverseWordsInAString.II.cpp diff --git a/src/reverseWordsInAString/reverseWordsInAString.cpp b/algorithms/reverseWordsInAString/reverseWordsInAString.cpp similarity index 100% rename from src/reverseWordsInAString/reverseWordsInAString.cpp rename to algorithms/reverseWordsInAString/reverseWordsInAString.cpp diff --git a/src/romanToInteger/romanToInteger.cpp b/algorithms/romanToInteger/romanToInteger.cpp similarity index 100% rename from src/romanToInteger/romanToInteger.cpp rename to algorithms/romanToInteger/romanToInteger.cpp diff --git a/src/rotateArray/rotateArray.cpp b/algorithms/rotateArray/rotateArray.cpp similarity index 100% rename from src/rotateArray/rotateArray.cpp rename to algorithms/rotateArray/rotateArray.cpp diff --git a/src/rotateImage/rotateImage.cpp b/algorithms/rotateImage/rotateImage.cpp similarity index 100% rename from src/rotateImage/rotateImage.cpp rename to algorithms/rotateImage/rotateImage.cpp diff --git a/src/rotateList/rotateList.cpp b/algorithms/rotateList/rotateList.cpp similarity index 100% rename from src/rotateList/rotateList.cpp rename to algorithms/rotateList/rotateList.cpp diff --git a/src/sameTree/sameTree.cpp b/algorithms/sameTree/sameTree.cpp similarity index 100% rename from src/sameTree/sameTree.cpp rename to algorithms/sameTree/sameTree.cpp diff --git a/src/scrambleString/scrambleString.cpp b/algorithms/scrambleString/scrambleString.cpp similarity index 100% rename from src/scrambleString/scrambleString.cpp rename to algorithms/scrambleString/scrambleString.cpp diff --git a/src/search2DMatrix/search2DMatrix.cpp b/algorithms/search2DMatrix/search2DMatrix.cpp similarity index 100% rename from src/search2DMatrix/search2DMatrix.cpp rename to algorithms/search2DMatrix/search2DMatrix.cpp diff --git a/src/searchForRange/searchForRange.cpp b/algorithms/searchForRange/searchForRange.cpp similarity index 100% rename from src/searchForRange/searchForRange.cpp rename to algorithms/searchForRange/searchForRange.cpp diff --git a/src/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp b/algorithms/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp similarity index 100% rename from src/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp rename to algorithms/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp diff --git a/src/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp b/algorithms/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp similarity index 100% rename from src/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp rename to algorithms/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp diff --git a/src/searchInsertPosition/searchInsertPosition.cpp b/algorithms/searchInsertPosition/searchInsertPosition.cpp similarity index 100% rename from src/searchInsertPosition/searchInsertPosition.cpp rename to algorithms/searchInsertPosition/searchInsertPosition.cpp diff --git a/src/setMatrixZeroes/setMatrixZeroes.cpp b/algorithms/setMatrixZeroes/setMatrixZeroes.cpp similarity index 100% rename from src/setMatrixZeroes/setMatrixZeroes.cpp rename to algorithms/setMatrixZeroes/setMatrixZeroes.cpp diff --git a/src/simplifyPath/simplifyPath.cpp b/algorithms/simplifyPath/simplifyPath.cpp similarity index 100% rename from src/simplifyPath/simplifyPath.cpp rename to algorithms/simplifyPath/simplifyPath.cpp diff --git a/src/singleNumber/singleNumber.II.cpp b/algorithms/singleNumber/singleNumber.II.cpp similarity index 100% rename from src/singleNumber/singleNumber.II.cpp rename to algorithms/singleNumber/singleNumber.II.cpp diff --git a/src/singleNumber/singleNumber.cpp b/algorithms/singleNumber/singleNumber.cpp similarity index 100% rename from src/singleNumber/singleNumber.cpp rename to algorithms/singleNumber/singleNumber.cpp diff --git a/src/sortColors/sortColors.cpp b/algorithms/sortColors/sortColors.cpp similarity index 100% rename from src/sortColors/sortColors.cpp rename to algorithms/sortColors/sortColors.cpp diff --git a/src/sortList/sortList.cpp b/algorithms/sortList/sortList.cpp similarity index 100% rename from src/sortList/sortList.cpp rename to algorithms/sortList/sortList.cpp diff --git a/src/spiralMatrix/spiralMatrix.II.cpp b/algorithms/spiralMatrix/spiralMatrix.II.cpp similarity index 100% rename from src/spiralMatrix/spiralMatrix.II.cpp rename to algorithms/spiralMatrix/spiralMatrix.II.cpp diff --git a/src/spiralMatrix/spiralMatrix.cpp b/algorithms/spiralMatrix/spiralMatrix.cpp similarity index 100% rename from src/spiralMatrix/spiralMatrix.cpp rename to algorithms/spiralMatrix/spiralMatrix.cpp diff --git a/src/sqrt/sqrt.cpp b/algorithms/sqrt/sqrt.cpp similarity index 100% rename from src/sqrt/sqrt.cpp rename to algorithms/sqrt/sqrt.cpp diff --git a/src/strStr/strStr.cpp b/algorithms/strStr/strStr.cpp similarity index 100% rename from src/strStr/strStr.cpp rename to algorithms/strStr/strStr.cpp diff --git a/src/stringToIntegerAtoi/stringToIntegerAtoi.cpp b/algorithms/stringToIntegerAtoi/stringToIntegerAtoi.cpp similarity index 100% rename from src/stringToIntegerAtoi/stringToIntegerAtoi.cpp rename to algorithms/stringToIntegerAtoi/stringToIntegerAtoi.cpp diff --git a/src/subsets/subsets.II.cpp b/algorithms/subsets/subsets.II.cpp similarity index 100% rename from src/subsets/subsets.II.cpp rename to algorithms/subsets/subsets.II.cpp diff --git a/src/subsets/subsets.cpp b/algorithms/subsets/subsets.cpp similarity index 100% rename from src/subsets/subsets.cpp rename to algorithms/subsets/subsets.cpp diff --git a/src/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp b/algorithms/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp similarity index 100% rename from src/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp rename to algorithms/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp diff --git a/src/sudokuSolver/sudokuSolver.cpp b/algorithms/sudokuSolver/sudokuSolver.cpp similarity index 100% rename from src/sudokuSolver/sudokuSolver.cpp rename to algorithms/sudokuSolver/sudokuSolver.cpp diff --git a/src/sumRootToLeafNumber/sumRootToLeafNumber.cpp b/algorithms/sumRootToLeafNumber/sumRootToLeafNumber.cpp similarity index 100% rename from src/sumRootToLeafNumber/sumRootToLeafNumber.cpp rename to algorithms/sumRootToLeafNumber/sumRootToLeafNumber.cpp diff --git a/src/surroundedRegions/surroundedRegions.cpp b/algorithms/surroundedRegions/surroundedRegions.cpp similarity index 100% rename from src/surroundedRegions/surroundedRegions.cpp rename to algorithms/surroundedRegions/surroundedRegions.cpp diff --git a/src/swapNodesInPairs/swapNodesInPairs.cpp b/algorithms/swapNodesInPairs/swapNodesInPairs.cpp similarity index 100% rename from src/swapNodesInPairs/swapNodesInPairs.cpp rename to algorithms/swapNodesInPairs/swapNodesInPairs.cpp diff --git a/src/symmetricTree/symmetricTree.cpp b/algorithms/symmetricTree/symmetricTree.cpp similarity index 100% rename from src/symmetricTree/symmetricTree.cpp rename to algorithms/symmetricTree/symmetricTree.cpp diff --git a/src/textJustification/textJustification.cpp b/algorithms/textJustification/textJustification.cpp similarity index 100% rename from src/textJustification/textJustification.cpp rename to algorithms/textJustification/textJustification.cpp diff --git a/src/trappingRainWater/trappingRainWater.cpp b/algorithms/trappingRainWater/trappingRainWater.cpp similarity index 100% rename from src/trappingRainWater/trappingRainWater.cpp rename to algorithms/trappingRainWater/trappingRainWater.cpp diff --git a/src/triangle/triangle.cpp b/algorithms/triangle/triangle.cpp similarity index 100% rename from src/triangle/triangle.cpp rename to algorithms/triangle/triangle.cpp diff --git a/src/twoSum/twoSum.II.cpp b/algorithms/twoSum/twoSum.II.cpp similarity index 100% rename from src/twoSum/twoSum.II.cpp rename to algorithms/twoSum/twoSum.II.cpp diff --git a/src/twoSum/twoSum.III.cpp b/algorithms/twoSum/twoSum.III.cpp similarity index 100% rename from src/twoSum/twoSum.III.cpp rename to algorithms/twoSum/twoSum.III.cpp diff --git a/src/twoSum/twoSum.cpp b/algorithms/twoSum/twoSum.cpp similarity index 100% rename from src/twoSum/twoSum.cpp rename to algorithms/twoSum/twoSum.cpp diff --git a/src/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp b/algorithms/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp similarity index 100% rename from src/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp rename to algorithms/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp diff --git a/src/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp b/algorithms/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp similarity index 100% rename from src/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp rename to algorithms/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp diff --git a/src/uniquePaths/uniquePaths.II.cpp b/algorithms/uniquePaths/uniquePaths.II.cpp similarity index 100% rename from src/uniquePaths/uniquePaths.II.cpp rename to algorithms/uniquePaths/uniquePaths.II.cpp diff --git a/src/uniquePaths/uniquePaths.cpp b/algorithms/uniquePaths/uniquePaths.cpp similarity index 100% rename from src/uniquePaths/uniquePaths.cpp rename to algorithms/uniquePaths/uniquePaths.cpp diff --git a/src/validNumber/validNumber.cpp b/algorithms/validNumber/validNumber.cpp similarity index 100% rename from src/validNumber/validNumber.cpp rename to algorithms/validNumber/validNumber.cpp diff --git a/src/validPalindrome/validPalindrome.cpp b/algorithms/validPalindrome/validPalindrome.cpp similarity index 100% rename from src/validPalindrome/validPalindrome.cpp rename to algorithms/validPalindrome/validPalindrome.cpp diff --git a/src/validParentheses/validParentheses.cpp b/algorithms/validParentheses/validParentheses.cpp similarity index 100% rename from src/validParentheses/validParentheses.cpp rename to algorithms/validParentheses/validParentheses.cpp diff --git a/src/validSudoku/validSudoku.cpp b/algorithms/validSudoku/validSudoku.cpp similarity index 100% rename from src/validSudoku/validSudoku.cpp rename to algorithms/validSudoku/validSudoku.cpp diff --git a/src/validateBinarySearchTree/validateBinarySearchTree.cpp b/algorithms/validateBinarySearchTree/validateBinarySearchTree.cpp similarity index 100% rename from src/validateBinarySearchTree/validateBinarySearchTree.cpp rename to algorithms/validateBinarySearchTree/validateBinarySearchTree.cpp diff --git a/src/wildcardMatching/wildcardMatching.cpp b/algorithms/wildcardMatching/wildcardMatching.cpp similarity index 100% rename from src/wildcardMatching/wildcardMatching.cpp rename to algorithms/wildcardMatching/wildcardMatching.cpp diff --git a/src/wordBreak/wordBreak.II.cpp b/algorithms/wordBreak/wordBreak.II.cpp similarity index 100% rename from src/wordBreak/wordBreak.II.cpp rename to algorithms/wordBreak/wordBreak.II.cpp diff --git a/src/wordBreak/wordBreak.cpp b/algorithms/wordBreak/wordBreak.cpp similarity index 100% rename from src/wordBreak/wordBreak.cpp rename to algorithms/wordBreak/wordBreak.cpp diff --git a/src/wordLadder/wordLadder.II.cpp b/algorithms/wordLadder/wordLadder.II.cpp similarity index 100% rename from src/wordLadder/wordLadder.II.cpp rename to algorithms/wordLadder/wordLadder.II.cpp diff --git a/src/wordLadder/wordLadder.cpp b/algorithms/wordLadder/wordLadder.cpp similarity index 100% rename from src/wordLadder/wordLadder.cpp rename to algorithms/wordLadder/wordLadder.cpp diff --git a/src/wordSearch/wordSearch.cpp b/algorithms/wordSearch/wordSearch.cpp similarity index 100% rename from src/wordSearch/wordSearch.cpp rename to algorithms/wordSearch/wordSearch.cpp diff --git a/src/zigZagConversion/zigZagConversion.cpp b/algorithms/zigZagConversion/zigZagConversion.cpp similarity index 100% rename from src/zigZagConversion/zigZagConversion.cpp rename to algorithms/zigZagConversion/zigZagConversion.cpp diff --git a/shell/TenthLine.sh b/shell/TenthLine.sh new file mode 100644 index 000000000..a6aefc8e5 --- /dev/null +++ b/shell/TenthLine.sh @@ -0,0 +1,42 @@ +# Source : https://leetcode.com/problems/tenth-line/ +# Author : Hao Chen +# Date : 2015-03-31 + +################################################################################## +# +# How would you print just the 10th line of a file? +# +# For example, assume that file.txt has the following content: +# +# Line 1 +# Line 2 +# Line 3 +# Line 4 +# Line 5 +# Line 6 +# Line 7 +# Line 8 +# Line 9 +# Line 10 +# +# Your script should output the tenth line, which is: +# +# Line 10 +# +# [show hint] +# Hint: +# 1. If the file contains less than 10 lines, what should you output? +# 2. There's at least three different solutions. Try to explore all possibilities. +################################################################################## + +#!/bin/sh + + +# Read from the file file.txt and output the tenth line to stdout. + +# Solution One +awk 'NR==10{print $0}' file.txt + +# Solution Two +sed -n '10p' file.txt + diff --git a/shell/TransposeFile.sh b/shell/TransposeFile.sh new file mode 100644 index 000000000..7e316967b --- /dev/null +++ b/shell/TransposeFile.sh @@ -0,0 +1,43 @@ +# Source : https://leetcode.com/problems/transpose-file/ +# Author : Hao Chen +# Date : 2015-03-31 + +################################################################################## +# +# Given a text file file.txt, transpose its content. +# +# You may assume that each row has the same number of columns and each field is separated by the ' ' character. +# +# For example, if file.txt has the following content: +# +# name age +# alice 21 +# ryan 30 +# +# Output the following: +# +# name alice ryan +# age 21 30 +################################################################################## + +#!/bin/sh + +# Read from the file file.txt and print its transposed content to stdout. +awk ' +{ + for (i = 1; i <= NF; i++) { + if (NR == 1){ + s[i]=$i; + }else{ + s[i] = s[i] " " $i; + } + } +} +END { + for (i = 1; s[i] != ""; i++) { + print s[i]; + } +}' file.txt + + + diff --git a/shell/ValidPhoneNumbers.sh b/shell/ValidPhoneNumbers.sh new file mode 100644 index 000000000..e9dd3d3b5 --- /dev/null +++ b/shell/ValidPhoneNumbers.sh @@ -0,0 +1,30 @@ +# Source : https://leetcode.com/problems/valid-phone-numbers/ +# Author : Hao Chen +# Date : 2015-03-31 + +################################################################################## +# +# Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers. +# +# You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit) +# +# You may also assume each line in the text file must not contain leading or trailing white spaces. +# +# For example, assume that file.txt has the following content: +# +# 987-123-4567 +# 123 456 7890 +# (123) 456-7890 +# +# Your script should output the following valid phone numbers: +# +# 987-123-4567 +# (123) 456-7890 +################################################################################## + +#!/bin/sh + + +# Read from the file file.txt and output all valid phone numbers to stdout. +grep -P '^(\d{3}-|\(\d{3}\) )\d{3}-\d{4}$' file.txt + diff --git a/shell/WordFrequency.sh b/shell/WordFrequency.sh new file mode 100644 index 000000000..b4bae8cb1 --- /dev/null +++ b/shell/WordFrequency.sh @@ -0,0 +1,38 @@ +# Source : https://leetcode.com/problems/word-frequency/ +# Author : Hao Chen +# Date : 2015-03-31 + +################################################################################## +# +# Write a bash script to calculate the frequency of each word in a text file words.txt. +# +# For simplicity sake, you may assume: +# +# words.txt contains only lowercase characters and space ' ' characters. +# Each word must consist of lowercase characters only. +# Words are separated by one or more whitespace characters. +# +# For example, assume that words.txt has the following content: +# the day is sunny the the +# the sunny is is +# +# Your script should output the following, sorted by descending frequency: +# +# the 4 +# is 3 +# sunny 2 +# day 1 +# +# Note: +# Don't worry about handling ties, it is guaranteed that each word's frequency count is unique. +# +# [show hint] +# Hint: +# Could you write it in one-line using Unix pipes? +################################################################################## + +#!/bin/sh + +# Read from the file words.txt and output the word frequency list to stdout. +cat words.txt | tr [:space:] "\n" | sed '/^$/d' | tr '[:upper:]' '[:lower:]'|sort|uniq -c|sort -nr | awk '{ print $2,$1}' +