Skip to content

Commit 16775c6

Browse files
author
Mark Rabins
authored
Minor Change
Updated the sort() function to sorted() based on Swift syntax changes.
1 parent eb8edb1 commit 16775c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kth Largest Element/README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The following solution is semi-naive. Its time complexity is **O(n log n)** sinc
1212
func kthLargest(a: [Int], k: Int) -> Int? {
1313
let len = a.count
1414
if k > 0 && k <= len {
15-
let sorted = a.sort()
15+
let sorted = a.sorted()
1616
return sorted[len - k]
1717
} else {
1818
return nil

0 commit comments

Comments
 (0)