Skip to content

Leet code solution in swift - Questions from Microsoft, Adobe and other companies

Notifications You must be signed in to change notification settings

charlieInDen/leetcodeswift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcodeswift

  1. Two Sum - https://leetcode.com/problems/two-sum
  2. Add Two Numbers - https://leetcode.com/problems/add-two-numbers
  3. Longest Substring Without Repeating Characters - https://leetcode.com/problems/longest-substring-without-repeating-characters
  4. Median of Two Sorted Arrays - https://leetcode.com/problems/median-of-two-sorted-arrays
  5. Longest Palindromic Substring - https://leetcode.com/problems/longest-palindromic-substring
  6. String to Integer (atoi) - https://leetcode.com/problems/string-to-integer-atoi
  7. Regular Expression Matching (Hard) - https://leetcode.com/problems/regular-expression-matching
  8. Container With Most Water - https://leetcode.com/problems/container-with-most-water
  9. Integer to Roman - https://leetcode.com/problems/integer-to-roman
  10. Roman to Integer - https://leetcode.com/problems/roman-to-integer
  11. Longest Common Prefix - https://leetcode.com/problems/longest-common-prefix/
  12. Letter Combinations of a Phone Number - https://leetcode.com/problems/letter-combinations-of-a-phone-number/
  13. Valid Parentheses - https://leetcode.com/problems/valid-parentheses/
  14. Merge Two Sorted Lists - https://leetcode.com/problems/merge-two-sorted-lists/
  15. Merge k Sorted Lists - https://leetcode.com/problems/merge-k-sorted-lists/
  16. Swap Nodes in Pairs - https://leetcode.com/problems/swap-nodes-in-pairs/
  17. Reverse Nodes in k-Group - https://leetcode.com/problems/reverse-nodes-in-k-group/
  18. Remove Duplicates from Sorted Array - https://leetcode.com/problems/remove-duplicates-from-sorted-array/
  19. Search in Rotated Sorted Array - https://leetcode.com/problems/search-in-rotated-sorted-array/
  20. Trapping Rain Water - https://leetcode.com/problems/trapping-rain-water/
  21. Wildcard Matching - https://leetcode.com/problems/wildcard-matching/
  22. Rotate Image - https://leetcode.com/problems/rotate-image/
  23. Group Anagrams - https://leetcode.com/problems/group-anagrams/
  24. Maximum Subarray - https://leetcode.com/problems/maximum-subarray/
  25. Spiral Matrix - https://leetcode.com/problems/spiral-matrix/
  26. Unique Paths II - https://leetcode.com/problems/unique-paths-ii/
  27. Sqrt(x) - https://leetcode.com/problems/sqrtx/
  28. Set Matrix Zeroes - https://leetcode.com/problems/set-matrix-zeroes/
  29. Search a 2D Matrix - https://leetcode.com/problems/search-a-2d-matrix/
  30. Search in Rotated Sorted Array II - https://leetcode.com/problems/search-in-rotated-sorted-array-ii/
  31. Binary Tree Inorder Traversal - https://leetcode.com/problems/binary-tree-inorder-traversal/
  32. Validate Binary Search Tree - https://leetcode.com/problems/validate-binary-search-tree/
  33. Binary Tree Level Order Traversal - https://leetcode.com/problems/binary-tree-level-order-traversal/
  34. Binary Tree Zigzag Level Order Traversal - https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/
  35. Maximum Depth of Binary Tree - https://leetcode.com/problems/maximum-depth-of-binary-tree/
  36. Construct Binary Tree from Preorder and Inorder Traversal - https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
  37. Binary Tree Level Order Traversal II - https://leetcode.com/problems/binary-tree-level-order-traversal-ii/
  38. Populating Next Right Pointers in Each Node - https://leetcode.com/problems/populating-next-right-pointers-in-each-node/
  39. Populating Next Right Pointers in Each Node II - https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/
  40. Best Time to Buy and Sell Stock - https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
  41. Best Time to Buy and Sell Stock II - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
  42. Best Time to Buy and Sell Stock III - https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
  43. Valid Palindrome - https://leetcode.com/problems/valid-palindrome/
  44. Clone Graph - https://leetcode.com/problems/clone-graph/
  45. Single Number - https://leetcode.com/problems/single-number/
  46. Copy List with Random Pointer - https://leetcode.com/problems/copy-list-with-random-pointer/
  47. Linked List Cycle - https://leetcode.com/problems/linked-list-cycle/
  48. LRU Cache - https://leetcode.com/problems/lru-cache/
  49. Sort List - https://leetcode.com/problems/sort-list/
  50. Reverse Words in a String - https://leetcode.com/problems/reverse-words-in-a-string/
  51. Find Minimum in Rotated Sorted Array II - https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/
  52. Course Schedule II - https://leetcode.com/problems/course-schedule-ii/
  53. Intersection of Two Linked Lists - https://leetcode.com/problems/intersection-of-two-linked-lists/
  54. Find Peak Element - https://leetcode.com/problems/find-peak-element/
  55. Majority Element - https://leetcode.com/problems/majority-element/
  56. Excel Sheet Column Number - https://leetcode.com/problems/excel-sheet-column-number/
  57. Rotate Array - https://leetcode.com/problems/rotate-array/
  58. Number of Islands - https://leetcode.com/problems/number-of-islands/
  59. Reverse Linked List - https://leetcode.com/problems/reverse-linked-list/
  60. Implement Trie (Prefix Tree) - https://leetcode.com/problems/implement-trie-prefix-tree/
  61. Design Add and Search Words Data Structure - https://leetcode.com/problems/design-add-and-search-words-data-structure/
  62. Word Search II - https://leetcode.com/problems/word-search-ii/
  63. Contains Duplicate - https://leetcode.com/problems/contains-duplicate/
  64. Lowest Common Ancestor of a Binary Search Tree - https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
  65. Lowest Common Ancestor of a Binary Tree - https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
  66. Product of Array Except Self - https://leetcode.com/problems/product-of-array-except-self/
  67. Sliding Window Maximum - https://leetcode.com/problems/sliding-window-maximum/
  68. Search a 2D Matrix II - https://leetcode.com/problems/search-a-2d-matrix-ii/
  69. Ugly Number II - https://leetcode.com/problems/ugly-number-ii/
  70. Missing Number - https://leetcode.com/problems/missing-number/
  71. Arranging Coins - https://leetcode.com/problems/arranging-coins/
  72. H-Index - https://leetcode.com/problems/h-index/
  73. First Bad Version - https://leetcode.com/problems/first-bad-version/
  74. Serialize and Deserialize Binary Tree - https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
  75. Coin Change - https://leetcode.com/problems/coin-change/
  76. Power of Four - https://leetcode.com/problems/power-of-four/
  77. Reverse String - https://leetcode.com/problems/reverse-string/
  78. Guess Number Higher or Lower - https://leetcode.com/problems/guess-number-higher-or-lower/
  79. Sum of Left Leaves - https://leetcode.com/problems/sum-of-left-leaves/
  80. Fizz Buzz - https://leetcode.com/problems/fizz-buzz/
  81. Add Two Numbers II - https://leetcode.com/problems/add-two-numbers-ii/
  82. Find All Numbers Disappeared in an Array - https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
  83. Serialize and Deserialize BST - https://leetcode.com/problems/serialize-and-deserialize-bst/
  84. Hamming Distance - https://leetcode.com/problems/hamming-distance/
  85. Coin Change 2 - https://leetcode.com/problems/coin-change-2/
  86. Detect Capital - https://leetcode.com/problems/detect-capital/
  87. Design HashSet - https://leetcode.com/problems/design-hashset/
  88. Unique Email Addresses - https://leetcode.com/problems/unique-email-addresses/
  89. Squares of a Sorted Array - https://leetcode.com/problems/squares-of-a-sorted-array/
  90. Cousins in Binary Tree - https://leetcode.com/problems/cousins-in-binary-tree/
  91. Rotting Oranges - https://leetcode.com/problems/rotting-oranges/
  92. Construct Binary Search Tree from Preorder Traversal - https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/
  93. Distribute Candies to People - https://leetcode.com/problems/distribute-candies-to-people/
  94. Maximum Length of a Concatenated String with Unique Characters - https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters/
  95. Iterator for Combination - https://leetcode.com/problems/iterator-for-combination/
  96. Design Browser History - https://leetcode.com/problems/design-browser-history/
  97. Encode and Decode TinyURL - https://leetcode.com/problems/encode-and-decode-tinyurl/
  98. Odd Even Linked List - https://leetcode.com/problems/odd-even-linked-list/
  99. Minimum Time Difference - https://leetcode.com/problems/minimum-time-difference/
  100. Count of Smaller Numbers After Self - https://leetcode.com/problems/count-of-smaller-numbers-after-self/
  101. Print Binary Tree - https://leetcode.com/problems/print-binary-tree/
  102. Largest Number - https://leetcode.com/problems/largest-number/
  103. Add to Array-Form of Integer - https://leetcode.com/problems/add-to-array-form-of-integer/
  104. Intersection of Two Arrays II - https://leetcode.com/problems/intersection-of-two-arrays-ii/
  105. Prison Cells After N Days - https://leetcode.com/problems/prison-cells-after-n-days/
  106. Find K-th Smallest Pair Distance - https://leetcode.com/problems/find-k-th-smallest-pair-distance/
  107. Remove Duplicates from Sorted Array II - https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
  108. Sequential Digits - https://leetcode.com/problems/sequential-digits/
  109. Sort Colors - https://leetcode.com/problems/sort-colors/
  110. Subsets II - https://leetcode.com/problems/subsets-ii/
  111. N-Queens - https://leetcode.com/problems/n-queens/
  112. Basic Calculator II - https://leetcode.com/problems/basic-calculator-ii/
  113. Jump Game - https://leetcode.com/problems/jump-game/
  114. Reaching Points - https://leetcode.com/problems/reaching-points/
  115. Number of 1 Bits - https://leetcode.com/problems/number-of-1-bits/
  116. Random Pick with Blacklist - https://leetcode.com/problems/random-pick-with-blacklist/
  117. Merge Intervals - https://leetcode.com/problems/merge-intervals/
  118. Length of Last Word - https://leetcode.com/problems/length-of-last-word/
  119. Spiral Matrix II - https://leetcode.com/problems/spiral-matrix-ii/
  120. N-Queens II - https://leetcode.com/problems/n-queens-ii/
  121. Can You Eat Your Favorite Candy on Your Favorite Day - https://leetcode.com/problems/can-you-eat-your-favorite-candy-on-your-favorite-day/
  122. Permutation Sequence - https://leetcode.com/problems/permutation-sequence/
  123. Binary Tree Vertical Order Traversal - https://leetcode.com/problems/binary-tree-vertical-order-traversal/
  124. Rotate List - https://leetcode.com/problems/rotate-list/
  125. Simplify Path - https://leetcode.com/problems/simplify-path/
  126. Gray Code - https://leetcode.com/problems/gray-code/
  127. Permutations II - https://leetcode.com/problems/permutations-ii/
  128. Combinations - https://leetcode.com/problems/combinations/
  129. Combination Sum II - https://leetcode.com/problems/combination-sum-ii/
  130. Decoded String at Index - https://leetcode.com/problems/decoded-string-at-index/
  131. ZigZag Conversion - https://leetcode.com/problems/zigzag-conversion/
  132. House Robber - https://leetcode.com/problems/house-robber/
  133. 3Sum - https://leetcode.com/problems/3sum/
  134. Longest Repeating Substring - https://leetcode.com/problems/longest-repeating-substring/
  135. Plus One - https://leetcode.com/problems/plus-one/
  136. Climbing Stairs - https://leetcode.com/problems/climbing-stairs/
  137. 4Sum - https://leetcode.com/problems/4sum/
  138. Longest Common Subsequence - https://leetcode.com/problems/longest-common-subsequence/
  139. Longest Palindromic Subsequence - https://leetcode.com/problems/longest-palindromic-subsequence/
  140. Employee Free Time - https://leetcode.com/problems/employee-free-time/
  141. Robot Room Cleaner - https://leetcode.com/problems/robot-room-cleaner/
  142. Best Meeting Point - https://leetcode.com/problems/best-meeting-point/
  143. First Missing Positive - https://leetcode.com/problems/first-missing-positive/
  144. Number of Good Pairs - https://leetcode.com/problems/number-of-good-pairs/
  145. Binary Tree Preorder Traversal - https://leetcode.com/problems/binary-tree-preorder-traversal/
  146. Subsets - https://leetcode.com/problems/subsets/
  147. Pascal's Triangle - https://leetcode.com/problems/pascals-triangle/
  148. Pascal's Triangle II - https://leetcode.com/problems/pascals-triangle-ii/

About

Leet code solution in swift - Questions from Microsoft, Adobe and other companies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages