X1336: Linear Search (Strings) Return Object

Complete the following linear search method. Find the string search in the array words. If the string is found, return the string found. If it is not found, return null. It is unspecified if the array is ordered or not, so assume it is not. The comparison should be case insensitive (i.e., look up equalsIgnoreCase()).

Examples:

linearSearch({"Charlotte", "Raleigh", "Greensboro"},"Charlotte") -> "Charlotte"
linearSearch({"Charlotte", "Raleigh", "Greensboro"},"Durham") -> null

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.