-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove implementation of Matrix struct and add exercise placeholder
- Loading branch information
1 parent
3c46168
commit 57f95d5
Showing
1 changed file
with
1 addition
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
struct Matrix { | ||
|
||
let rows: [[Int]] | ||
let columns: [[Int]] | ||
|
||
init(_ stringRepresentation: String) { | ||
var rows = [[Int]]() | ||
var columns = [[Int]]() | ||
|
||
let rowItems = stringRepresentation.split(separator: "\n") | ||
for item in rowItems { | ||
let elements = item.split(separator: " ").compactMap { Int(String($0)) } | ||
rows.append(elements) | ||
} | ||
for i in 0..<rows[0].count { | ||
var column = [Int]() | ||
for row in rows { | ||
column.append(row[i]) | ||
} | ||
|
||
columns.append(column) | ||
} | ||
|
||
self.rows = rows | ||
self.columns = columns | ||
} | ||
// Write your code for the 'Matrix' exercise in this file. | ||
} |