How can I deal with this error without creating additional variable?
func reduceToZero(x:Int) -> Int {
while (x != 0) {
x = x-1 // ERROR: cannot assign to 'let' value 'x'
}
return x
}
I don't want to create additional variable just to store the value of x. Is it even possible to do what I want?