We all use search everyday; to find a file in a directory, to find an email in the inbox, to find a song in a playlist. Search is more than just a linear scan through a list of texts in a dictionary; It’s binary search, it’s indexing, it’s using your full text search algorithms to solve one of the hardest problems we know. – adapted from NUMB3RS Given a dictionary containing less than N = 20000 words labeled from 1 to N. Each word consists of lowercase characters (from ‘a’ to ‘z’) with arbitrary length. The total number of characters in the dictionary is at most 100,000. Your task is to answer at most Q = 100000 queries. Each query qi is also a word (as defined above). For each query, you have to print the “Top 10” words in the dictionary with the following rules: • All the words in the “Top 10” have to contain the substring qi. • All the words in the “Top 10” have to be sorted in this order:
2/2 and nine arranged by universitas bina nusantara especially for you 5 a an win b z Sample Output 1 8 4 13 5 10 3 7 14 15 8 10 7 14 -1 11 13 -1