#This problem was asked by Twitter.
'''Implement an autocomplete system. That is, given a query string s and a set of all
possible query strings, return all strings in the set that have s as a prefix.
For example, given the query string de and the set of strings [dog, deer, deal], return
[deer, deal].'''
a = ['dog', 'deer', 'deal']
p = 'b'
lst = []
for i in a:
   if i.startswith(p):
       lst.append(i)
print(lst)       
