Given a dictionary of n words. You have to display the size of dictionary before and after.
The first line of input contains T denoting thr number of testcases. T testcases follow. Each testcase contains 4 lines of input. The first line contains the number of words n. 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. . The 4th line contains pagenumber x.
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. Your task is to complete the two functions - Dictionary() which accepts dictionary, and sizeAfterRemoval() which accepts dictionary and the page number. You have to display the word at that page and evaluate the size after removing the word at the specified page.
1 <= T <= 100
1 <= n <= 1000
123 456 500 550 600
study reference learn code practice
Size before removing word: 5
Word removed from dictionary: practice
Size after removing word: 4
Testcase1: Initially we have 5 words, so size is 5. Then we remove the words that is mapped to page number 600. Now size becomes 4.
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.