Skip to content

N-ihad/LeetCode-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Swift

Some solved LeetCode problems in Swift I thought I'd share if someone needs (among like tens of thousands of other resources out there but here it goes anyway)

Contacts

Branches

Problems are categorized into: easy, medium, hard within branches

Problems

Easy

Source Solution Tests
Backspace String Compare Swift Tests
Best Time to Buy and Sell Stock Swift Tests
Binary Tree Inorder Traversal Swift Tests
Binary Tree Paths Swift Tests
Climbing Stairs Swift Tests
Contains Duplicate Swift Tests
Delete Node in a Linked List Swift
Diameter of Binary Tree Swift Tests
Find Pivot Index Swift Tests
First Unique Character in a String Swift Tests
Fizz Buzz Swift Tests
Happy Number Swift Tests
Intersection of Two Arrays II Swift Tests
Intersection of Two Linked Lists Swift
Length of Last Word Swift, C++ Tests
Linked List Cycle Swift Tests
Majority Element Swift Tests
Maximum Depth of Binary Tree Swift Tests
Merge Two Sorted Lists Swift Tests
Minimum Difference Between Highest and Lowest of K Scores Swift
Minimum Recolors to Get K Consecutive Black Blocks Swift
Missing Number Swift Tests
Move Zeroes Swift Tests
Pascals Triangle Swift Tests
Plus One Swift Tests
Remove Duplicates From Sorted Array Swift Tests
Remove Element Swift Tests
Reverse Linked List Swift Tests
Roman to Integer Swift
Same Tree Swift Tests
Single Number Swift Tests
Symmetric Tree Swift Tests
Two Sum Swift
Valid Anagram Swift Tests
Valid Parentheses Swift, C++ Tests
Path Sum Swift Tests
Detect Capital Swift Tests
Delete Columns to Make Sorted Swift Tests
Word Pattern Swift Tests
Binary Tree Preorder Traversal Swift
Balanced Binary Tree Swift
Valid Palindrome Swift
Remove Linked List Elements Swift
Intersection of Two Arrays Swift
Contains Duplicate II Swift
Implement Stack using Queues Swift
Replace Elements with Greatest Element on Right Side Swift
Ransom Note Swift
Sum of Left Leaves Swift
Is Subsequence Swift
Reshape the Matrix Swift
Reverse Vowels of a String Swift
Find Winner on a Tic Tac Toe Game Swift
Number of Good Pairs Swift
Shuffle the Array Swift
Left and Right Sum Differences Swift
Convert Sorted Array to Binary Search Tree Swift
N-ary Tree Preorder Traversal Swift
Check If Two String Arrays are Equivalent Swift
Largest 3-Same-Digit Number in String Swift
Count of Matches in Tournament Swift
Calculate Money in Leetcode Bank Swift
Largest Odd Number in String Swift
Construct String from Binary Tree Swift
Transpose Matrix Swift
Element Appearing More Than 25% In Sorted Array Swift
Maximum Product of Two Elements in an Array Swift
Special Positions in a Binary Matrix Swift
Destination City Swift
Maximum Product Difference Between Two Pairs Swift
Summary Ranges Swift
Pascal's Triangle II Swift
Image Smoother Swift
Buy Two Chocolates Swift
Maximum Score After Splitting a String Swift
Path Crossing Swift
Minimum Changes To Make Alternating Binary String Swift
Middle of the Linked List Swift
Search Insert Position Swift

Medium

Source Solution Tests
Maximum Subarray Swift Tests
Min Stack Swift Tests
Add Two Numbers Swift Tests
Airplane Seat Assignment Probability Swift Tests
Binary Tree Level Order Traversal II Swift Tests
Binary Tree Level Order Traversal Swift
Binary Tree Zigzag Level Order Traversal Swift Tests
Combination Sum 2 Swift Tests
Combination Sum Swift Tests
Combinations Swift Tests
Container With Most Water Swift Tests
Copy List With Random Pointer Swift
Course Schedule Swift Tests
Design Add and Search Words Data Structure Swift Tests
Find Bottom Left Tree Value Swift Tests
Find the Duplicate Number Swift Tests
Flatten Binary Tree to Linked List Swift
Game of Life Swift Tests
Generate Parentheses Swift Tests
Group Anagrams Swift Tests
House Robber Swift Tests
Insert Delete Get Random O(1) Swift
Integer to Roman Swift Tests
Jump Game Swift Tests
Kth Largest Element in an Array Swift
Kth Smallest Element in a BST Swift Tests
LRU Cache Swift Tests
Letter Combinations of a Phone Number Swift Tests
Longest Consecutive Sequence Swift Tests
Longest Increasing Subsequence Swift Tests
Longest Palindromic Substring Swift, C++
Longest Substring Without Repeating Characters Swift Tests
Merge Intervals Swift Tests
Minimum Path Sum Swift Tests
My Calendar I Swift Tests
Number of Islands Swift Tests
Odd Even Linked List Swift
Palindrome Partitioning Swift Tests
Permutations Swift Tests
Product of Array Except Self Swift Tests
Push Dominoes Swift Tests
Remove Nth Node from End of List Swift
Reverse Integer Swift Tests
Reverse Words in a String Swift Tests
Rotate Array Swift Tests
Rotate Image Swift Tests
Rotate List Swift
Search a 2D Matrix II Swift Tests
Set Matrix Zeroes Swift Tests
Sort Colors Swift Tests
Sort the Matrix Diagonally Swift Tests
Subsets Swift Tests
Top K Frequent Elements Swift Tests
Unique Binary Search Trees Swift Tests
Unique Paths Swift Tests
Valid Sudoku Swift Tests
Validate Binary Search Tree Swift Tests
Word Break Swift Tests
Word Search Swift Tests
Path Sum II Swift Tests
Sum Root to Leaf Numbers Swift Tests
Minimum Rounds to Complete All Tasks Swift Tests
Gas Station Swift Tests
Minimum Number of Arrows to Burst Balloons Swift Tests
Maximum Ice Cream Bars Swift Tests
Zigzag Conversion Swift Tests
Sort List Swift
Minimum Time to Collect All Apples in a Tree Swift
Number of Nodes in the Sub-Tree With the Same Label Swift
Swap Nodes in Pairs Swift
Lexicographically Smallest Equivalent String Swift Tests
Insert Interval Swift
Find Closest Node to Given Two Nodes Swift
Maximum Product Subarray Swift
Shuffle an Array Swift
Two Sum II - Input Array Is Sorted Swift
Find Peak Element Swift
Evaluate Reverse Polish Notation Swift
Course Schedule Swift
Largest Number Swift
Find First and Last Position of Element in Sorted Array Swift
Surrounded Regions Swift
Course Schedule II Swift
Clone Graph Swift
Binary Tree Right Side View Swift
Populating Next Right Pointers in Each Node Swift
Coin Change Swift
Eliminate Maximum Number of Monsters Swift
Perfect Squares Swift
Minimum Height Trees Swift
Basic Calculator II Swift
Triangle Swift
Implement Trie (Prefix Tree) Swift
Best Time to Buy and Sell Stock II Swift
Difference Between Ones and Zeros in Row and Column Swift
Lowest Common Ancestor of a Binary Tree Swift
Design a Food Rating System Swift
Widest Vertical Area Between Two Points Containing No Points Swift
Minimum Falling Path Sum Swift
Length of Longest Subarray With at Most K Frequency Swift
Minimum Size Subarray Sum Swift

Hard

Source Solution Tests
Binary Tree Maximum Path Sum Swift Tests
Edit Distance Swift Tests
First Missing Positive Swift Tests
Longest Increasing Path in a Matrix Swift Tests
Max Points on a Line Swift Tests
Median of Two Sorted Arrays Swift Tests
Merge k Sorted Lists Swift Tests
N-Queens2 Swift Tests
N-Queens Swift Tests
Serialize and Deserialize Binary Tree Swift
Sliding Window Maximum Swift Tests
Sudoku Solver Swift Tests
Trapping Rain Water Swift Tests
Wildcard Matching Swift Tests
Work Break II Swift Tests
Reverse Nodes in k-Group Swift
Maximum Score Words Formed by Letters Swift

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages