Skip to content

Commit 17d2bc6

Browse files
committed
Added swift solutions
1 parent ca2f02e commit 17d2bc6

File tree

149 files changed

+6979
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+6979
-67
lines changed

README.md

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
> ["For coding interview preparation, LeetCode is one of the best online resource providing a rich library of more than 300 real coding interview questions for you to practice from using one of the 7 supported languages - C, C++, Java, Python, C#, JavaScript, Ruby."](https://www.quora.com/How-effective-is-Leetcode-for-preparing-for-technical-interviews)
1111
1212
##
13-
* [SQL I](#sql-i)
1413
* [Level 1](#level-1)
1514
* [Level 2](#level-2)
1615
* [Udemy](#udemy)
@@ -24,58 +23,7 @@
2423
* [Programming Skills I](#programming-skills-i)
2524
* [Programming Skills II](#programming-skills-ii)
2625
* [Graph Theory I](#graph-theory-i)
27-
28-
### SQL I
29-
30-
#### Day 1 Select
31-
32-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
33-
|-|-|-|-|-|-|-
34-
35-
#### Day 2 Select and Order
36-
37-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
38-
|-|-|-|-|-|-|-
39-
40-
#### Day 3 String Processing Functions
41-
42-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
43-
|-|-|-|-|-|-|-
44-
45-
#### Day 4 Union and Select
46-
47-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
48-
|-|-|-|-|-|-|-
49-
50-
#### Day 5 Union
51-
52-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
53-
|-|-|-|-|-|-|-
54-
55-
#### Day 6 Union
56-
57-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
58-
|-|-|-|-|-|-|-
59-
60-
#### Day 7 Function
61-
62-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
63-
|-|-|-|-|-|-|-
64-
65-
#### Day 8 Function
66-
67-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
68-
|-|-|-|-|-|-|-
69-
70-
#### Day 9 Control of Flow
71-
72-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
73-
|-|-|-|-|-|-|-
74-
75-
#### Day 10 Where
76-
77-
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
78-
|-|-|-|-|-|-|-
26+
* [SQL I](#sql-i)
7927

8028
### Level 1
8129

@@ -1406,6 +1354,58 @@
14061354
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
14071355
|-|-|-|-|-|-|-
14081356

1357+
### SQL I
1358+
1359+
#### Day 1 Select
1360+
1361+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1362+
|-|-|-|-|-|-|-
1363+
1364+
#### Day 2 Select and Order
1365+
1366+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1367+
|-|-|-|-|-|-|-
1368+
1369+
#### Day 3 String Processing Functions
1370+
1371+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1372+
|-|-|-|-|-|-|-
1373+
1374+
#### Day 4 Union and Select
1375+
1376+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1377+
|-|-|-|-|-|-|-
1378+
1379+
#### Day 5 Union
1380+
1381+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1382+
|-|-|-|-|-|-|-
1383+
1384+
#### Day 6 Union
1385+
1386+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1387+
|-|-|-|-|-|-|-
1388+
1389+
#### Day 7 Function
1390+
1391+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1392+
|-|-|-|-|-|-|-
1393+
1394+
#### Day 8 Function
1395+
1396+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1397+
|-|-|-|-|-|-|-
1398+
1399+
#### Day 9 Control of Flow
1400+
1401+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1402+
|-|-|-|-|-|-|-
1403+
1404+
#### Day 10 Where
1405+
1406+
| <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- --> | <!-- -->
1407+
|-|-|-|-|-|-|-
1408+
14091409
## Algorithms
14101410

14111411
| # | Title | Language | Difficulty | Tag | Time, ms | Time, %

src/main/swift/g0001_0100/s0002_add_two_numbers/Solution.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #Data_Structure_II_Day_10_Linked_List #Programming_Skills_II_Day_15
33
// #Big_O_Time_O(max(N,M))_Space_O(max(N,M)) #2024_06_17_Time_17_ms_(76.59%)_Space_15.7_MB_(14.57%)
44

5-
/*
5+
/**
66
* Definition for singly-linked list.
77
* public class ListNode {
88
* public var val: Int
@@ -13,7 +13,6 @@
1313
* }
1414
*/
1515
class Solution {
16-
1716
func addTwoNumbers(_ l1: ListNode?, _ l2: ListNode?) -> ListNode? {
1817
return addNumbers(l1, l2, 0)
1918
}

src/main/swift/g0001_0100/s0002_add_two_numbers/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To solve the Add Two Numbers problem in Swift using a `Solution` class, we'll fo
5050
Here's the implementation:
5151

5252
```swift
53-
/*
53+
/**
5454
* Definition for singly-linked list.
5555
* public class ListNode {
5656
* public var val: Int

src/main/swift/g0001_0100/s0004_median_of_two_sorted_arrays/Solution.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ public class Solution {
3838
return 0.0
3939
}
4040
}
41-

src/main/swift/g0001_0100/s0005_longest_palindromic_substring/Solution.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ public class Solution {
4545
return String(s[s.index(s.startIndex, offsetBy: start)..<s.index(s.startIndex, offsetBy: end)])
4646
}
4747
}
48-

src/main/swift/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #Algorithm_I_Day_5_Two_Pointers #Level_2_Day_3_Linked_List #Big_O_Time_O(L)_Space_O(L)
33
// #2024_06_18_Time_0_ms_(100.00%)_Space_15.5_MB_(48.03%)
44

5-
/*
5+
/**
66
* Definition for singly-linked list.
77
* public class ListNode {
88
* public var val: Int

src/main/swift/g0001_0100/s0021_merge_two_sorted_lists/Solution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// #Level_1_Day_3_Linked_List #Udemy_Linked_List #Big_O_Time_O(m+n)_Space_O(m+n)
44
// #2024_06_18_Time_3_ms_(96.41%)_Space_15.9_MB_(6.39%)
55

6-
/*
6+
/**
77
* Definition for singly-linked list.
88
* public class ListNode {
99
* public var val: Int

src/main/swift/g0001_0100/s0023_merge_k_sorted_lists/Solution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #Divide_and_Conquer #Merge_Sort #Big_O_Time_O(k*n*log(k))_Space_O(log(k))
33
// #2024_06_19_Time_25_ms_(94.57%)_Space_17.3_MB_(6.09%)
44

5-
/*
5+
/**
66
* Definition for singly-linked list.
77
* public class ListNode {
88
* public var val: Int

src/main/swift/g0001_0100/s0024_swap_nodes_in_pairs/Solution.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #Udemy_Linked_List #Big_O_Time_O(n)_Space_O(1)
33
// #2024_06_19_Time_0_ms_(100.00%)_Space_15.8_MB_(10.29%)
44

5-
/*
5+
/**
66
* Definition for singly-linked list.
77
* public class ListNode {
88
* public var val: Int

src/main/swift/g0001_0100/s0024_swap_nodes_in_pairs/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To solve the "Swap Nodes in Pairs" problem in Swift with a `Solution` class, we
4747
Here's the implementation:
4848

4949
```swift
50-
/*
50+
/**
5151
* Definition for singly-linked list.
5252
* public class ListNode {
5353
* public var val: Int

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy