Sentence Similarity

easy
1. You will be given two sentences in form of array of string
 2. You will also be given a 2d array of string with mapping from sentence1 array to sentenc2 array
 3. You need to check if all the words(elements) in sentence1 can be mapped to those in sentenc2
 4. Note that mapping given is not transitive. However, it is reflexive and symmetric.
 5. If length of the two sentences is not same, it is NOT possible to map them whatsoever
 6. Input and output is handled for you
 7. It is a functional problem ,please do not modify main()

Input Format

Input is handled for you.

Output Format

Return boolean Output handled

Constraints

The length of words in sentence1 and sentence2 will not exceed 1000.
 The length of pairs will not exceed 2000.
 The length of each pairs[i] will be 2.
 The length of each words[i] and pairs[i][j] will be in the range [1, 20].

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
sun rises in east
4
earth is a sphere
4
sun earth rises is in a east sphere
Output
true
Next
Redundant Connection

Related Questions