Equal to 42 or Not
EasyP3Coding
Return true if the number 42 appears in nums, otherwise false.
Example 1
- Input
- nums = [1,42,3]
- Output
- true
Example 2
- Input
- nums = [1,2,3]
- Output
- false
Example 3
- Input
- nums = []
- Output
- false
Constraints
- 0 <= nums.length <= 10^5
- -10^9 <= nums[i] <= 10^9
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 10. ⌘Enter runs, ⌘⇧Enter submits.