Last active
March 3, 2021 22:06
-
-
Save Exey/9c25e3780c34ed7b5e07e70ceab1062e to your computer and use it in GitHub Desktop.
not compilable
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
let array = [Int]() | |
let dic = [Int : Double]() | |
let tuple = array | |
.map { c -> (a: Int, b: Double) in return (a: c, b: dic[c]!) } | |
.sorted(by: { (x, y) -> Bool in return x.b == y.b ? x.a < y.a : x.b > y.b }).first! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment