Longest Word In Dictionary Through Deleting
easy
1.Given a string and a string dictionary. 2.Find the longest string in the dictionary that can be formed by deleting some characters of the given string. 3.You have to complete the function findLongestWord() that should return a string. 4.If there are more than one possible results, return the longest word with the smallest lexicographical order. 5.If there is no possible result, return the empty string.
Constraints
1.String will contains lowercase characters only. 2.1<=N<=1000
Format
Input
1.First line contains a string. 2.Second line contains an Integer 'N'. 3.Third line contains N separated strings.
Output
Return a string
Example
Sample Input
abpcplea
4
ale
apple
monkey
plea
Sample Output
apple