Skip to content

bofeizhu/LeetCode-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Swift

LeetCode Swift

Main Features
💯 All the solutions have been accepted by the judge of LeetCode.com
🎯 Each playground comes with a suite of unit tests.
🐥 Written in Swift 4.2
💎 Follow Google's Swift Style Guide
🔍 ⌘ + F to search problem name or problam # in README

Problems & Solutions

# Problem Solution Approach
1 Two Sum Solution Dictionary
2 Add Two Numbers Solution Elementary math
3 Longest Substring Without Repeating Characters Solution Sliding Window with Dictionary
4 Median of Two Sorted Arrays Solution Recursive & Binary search
5 Longest Palindromic Substring Solution Manacher’s algorithm
6 ZigZag Conversion Solution Visit by Row
7 Reverse Integer Solution Pop and Push Digits
8 String to Integer (atoi) Solution Iteration
9 Palindrome Number Solution Revert half of the number
10 Regular Expression Matching Solution Dynamic Programming
11 Container With Most Water Solution Two Pointers
12 Integer to Roman Solution Iteration
13 Roman to Integer Solution Iteration
14 Longest Common Prefix Solution Vertical scanning
15 Three Sum Solution Two Pointers
16 Three Sum Closest Solution Two Pointers
17 Letter Combinations of a Phone Number Solution Backtracking
18 Four Sum Solution Two Pointers
19 Remove Nth Node From End of List * Solution Two Pointers
20 Valid Parentheses Solution Stack
21 Merge Two Sorted Lists Solution Iteration
22 Generate Parentheses Solution Backtracking
23 Merge k Sorted Lists Solution Divide And Conquer
24 Swap Nodes in Pairs Solution Iteration
25 Reverse Nodes in k-Group * Solution Two Pointers
26 Remove Duplicates from Sorted Array Solution Two Pointers
27 Remove Element Solution Two Pointers
28 Implement strStr() Solution String
29 Divide Two Integers Solution String

Releases

No releases published

Packages

No packages published

Languages