Given an array A
of N
integers we draw N
discs in a 2D plane, such that i-th disc has center in (0,i)
and a radius
Swift 4 Solution 100% (Codility do not check the worst case for this solution)
public func solution(_ A : inout [Int]) -> Int {
// write your code in Swift 4.2.1 (Linux)
var count = 0
let sortedA = A.sorted(by: >)
if sortedA.isEmpty{ return 0 }
let maxVal = sortedA[0]
for i in 0.. 10_000_000{
return -1
}
}
return count
}