macOS, iOS
swift 배열에서 가장 큰 값(maxValue) 찾는 법
SweetDev
2019. 11. 7. 18:59
https://stackoverflow.com/questions/24036514/correct-way-to-find-max-in-an-array-in-swift
Correct way to find max in an Array in Swift
I've so far got a simple (but potentially expensive) way: var myMax = sort(myArray,>)[0] And how I was taught to do it at school: var myMax = 0 for i in 0..myArray.count { if (myArray[i] ...
stackoverflow.com
numbers.max()가 된다.
스위프트 갓갓 ^^77
data.values.max()
딕셔너리에서도 쓸 수 있다.