wes d2a2ba9e15 first commit | hace 4 años | |
---|---|---|
.. | ||
README.md | hace 4 años | |
code.cpp | hace 4 años | |
unitTest.cpp | hace 4 años |
by Helen Yu tags: arrays, validation, language_fundamentals
Write a function to check if an array contains a particular number. Examples check([1, 2, 3, 4, 5], 3) ➞ true check([1, 1, 2, 1, 1], 3) ➞ false check([5, 5, 5, 6], 5) ➞ true check([], 5) ➞ false Notes Don't forget to return the result. If you get stuck on a challenge, find help in the Resources tab. If you're really stuck, unlock solutions in the Solution
Write a function to check if an array contains a particular number.
check([1, 2, 3, 4, 5], 3) ➞ true
check([1, 1, 2, 1, 1], 3) ➞ false
check([5, 5, 5, 6], 5) ➞ true
check([], 5) ➞ false
return
the result.