Created
August 8, 2015 03:31
-
-
Save Himenon/26befb79d247c6f66b8d to your computer and use it in GitHub Desktop.
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 ans: [Int] = [1, 0, 1, 1, 1] | |
var submit: [Int] = [1, 1, 1, 1, 1] | |
func check(answer: [Int], submit: [Int]) -> Bool { | |
for i in 0..<answer.count { | |
if answer[i] != submit[i]{ return false } | |
} | |
return true | |
} | |
func updateSubmitArray (inout submitArray submit: [Int], #tag: Int, updateValue value: Int) -> [Int] { | |
if tag > 0 || tag < submit.count { | |
submit[tag] = value | |
} | |
return submit | |
} | |
var arr: [Int] = [1, 2, 3] | |
updateSubmitArray(submitArray: &arr, tag: 2, updateValue: 10) | |
check(ans, submit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment