id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

srp4379@lausd.net > search
prev  |  next  |  chance

public boolean search(int val, int[] list)

Given a list of integers and an integer, return true if the integer (val) is in the list, false if not.

Note: You can solve this using a for-each loop.


search(4, [2, 3, 4, 5, 6]) → true
search(8, [2, 3, 4, 5, 6]) → false
search(4, [12, 13, 14, 15, 16]) → false

...Save, Compile, Run (ctrl-enter)

public boolean search(int val, int[] list) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy