[go: nahoru, domu]

Skip to content

Commit

Permalink
Submit 378_KthSmallestElementinaSortedMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Binlogo committed Jul 2, 2020
1 parent 0353b7f commit b03a0bf
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//: [Previous](@previous)

import Foundation

class Solution {
func kthSmallest(_ matrix: [[Int]], _ k: Int) -> Int {
return matrix.flatMap { $0 }.sorted()[k-1]
}
}

//: [Next](@next)

0 comments on commit b03a0bf

Please sign in to comment.