Given two arrays pages and words of size n. The array of pages contains the page numbers and array of words contains n words. You have to map each word corresponding to its page number and you need to find the word that is mapped to page number x. If there is no word on x, print null.
The first line of input contains T denoting thr number of testcases. T testcases follow. Each testcase contains 2 lines of input. The first line contains the number of words n and x. The second line contains the n page numbers separated by space. The third line contains n words separated by space. The ith index of word array corresponds to ith index of page numbers array. .
For each testcase, in a new line, print the required answer.
Since this is a function problem, you don't need to take any input. Just complete the function Dictionary().
1 <= T <= 100
1 <= n <= 1000
123 345 456 500 550
learn code practice study geeks
There is no word in the dictionary at page number 600 so it prints null.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.