티스토리 뷰
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()
딕셔너리에서도 쓸 수 있다.
'macOS, iOS' 카테고리의 다른 글
[Swift] 배열에서 같은 요소를 제거하기 (0) | 2019.11.07 |
---|---|
swift flatmap (0) | 2019.11.07 |
[Swift] 선언과 동시에 초기화하는 매우 많은 방법들 (0) | 2019.11.07 |
[Swift] do nothing을 어떻게 표현할까 (0) | 2019.11.07 |
swift random함수 (0) | 2019.11.07 |