Last active
September 1, 2018 14:07
-
-
Save jacquesgiraudel/47d50c9cd6122fdbd61bca32aae8a07c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun findByTitle(query: String, collection: MutableList<Movie>): List<Movie>{ | |
var results: MutableList<Movie> = mutableListOf() | |
do { | |
val movie = collection.removeAt(0) | |
if (movie.title.contains(query)){ | |
results.add(movie) | |
} | |
} | |
while (collection.size > 0) | |
return results | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment