def foo( vals ): output = vals[0] for x in vals[1:]: if output < x: output = x return x
2. The answer should be "The maximum value", not "The minimum value"
Also, it could be nice if after you solve a riddle you would get a new one.
$ git checkout -b feature
func foo( _ nums: [Int] ) -> Int { var sum = 0 var _ = nums.map {sum += $0} return (nums.count * ((nums.count+1) / 2)) - sum }
return ((nums.count+1) * ((nums.count+2) / 2)) - sum
Is a leaderboard something that would appeal to you?
int main() { int array[] = { 1, 2, 3, 4, 5}; int *ptr; ptr = a; ptr++;
return 0;
This won't compile, but the answer says it should be 2
2. The answer should be "The maximum value", not "The minimum value"
Also, it could be nice if after you solve a riddle you would get a new one.