wes d2a2ba9e15 first commit 4 lat temu
..
README.md d2a2ba9e15 first commit 4 lat temu
code.cpp d2a2ba9e15 first commit 4 lat temu
unitTest.cpp d2a2ba9e15 first commit 4 lat temu

README.md

Check if an Array Contains a Given Number

by Helen Yu tags: arrays, validation, language_fundamentals

Summary

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

Instructions

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 Solutions tab.