Skip to content

Instantly share code, notes, and snippets.

@jacquesgiraudel
Last active September 1, 2018 14:07
Show Gist options
  • Save jacquesgiraudel/47d50c9cd6122fdbd61bca32aae8a07c to your computer and use it in GitHub Desktop.
Save jacquesgiraudel/47d50c9cd6122fdbd61bca32aae8a07c to your computer and use it in GitHub Desktop.
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