Match Specific Pattern

easy
1.Given a dictionary of words and a pattern. 2.Every character in the pattern is uniquely mapped to a character in the dictionary. 3.The task is to complete a function findMatchedWords(dict,pattern) that returns a vector of strings matching with given pattern. 4.The function takes two argument the first argument is an array of strings dict which denote the dictionary and the second argument is the pattern to match.

Input Format

1.First line contains an integer 'N' denoting the number of strings in the dictionary. 2.Second line contains 'N' space separated Strings in the dictionary. 3.Third line contains pattern.

Output Format

Return List of string that matches the given pattern.

Constraints

1<=N<=10

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
4
abb abc xyz xyy
foo
Output
[abb, xyy]
Previous
Winner Of An Election
Next
Maximum Distance In Arrays

Related Questions