Skip to content

Commit

Permalink
Remove implementation of Matrix struct and add exercise placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
meatball133 committed Dec 30, 2024
1 parent 3c46168 commit 57f95d5
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions exercises/practice/matrix/Sources/Matrix/Matrix.swift
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.
}

0 comments on commit 57f95d5

Please sign in to comment.