Given an array of integers nums and another integer value, check if value occurs in nums.
If the value occurs in nums, return true; otherwise return false.
Examples:
contains([]int{1, 2, 4, 5}, 4) -> true
contains([]int{-1, 2, -4, 0, 10}, 7) -> false
Note:
Do not use builtin functions such as slices.Contains(), it would defy the purpose of the challenge. Write the whole code yourself.
Free plan: 30 tutor messages. PRO is unlimited.
Saved
Ctrl + Enter to check
