1. set input array of db
  2. get input from the user
  3. if(db_array.startsWith(inout_query)) {
    matched.add(db_array.get(i));

    OR Use Trie datastructure

Advertisements