I am converting some algorithm pseudo code to Swift and have the following function:
func max(a: [Int], b: Int) { var result = a[0] var i: Int for (i =
You must Implement the return type like this
func max(inout a: [Int], b: Int)-> Int { var result = a[0] var i: Int for (i = 1; i <= b; i++) { if (a[i] > result) { result = a[i] } } return result }