@@ -0,0 +1,2276 @@
+package thirty_days_of_code;%0D%0A%0D%0Aimport java.util.*;%0D%0A%0D%0A/*%0D%0A * Problem Statement:%0D%0A * You are given a phone book that consists of your friend's names and their%0D%0A * phone number. After that you will be given your friend's name as query. For%0D%0A * each query, print the phone number of your friend.%0D%0A * %0D%0A * Input Format: %0D%0A * The first line will have an integer N denoting the number of entries in the%0D%0A * phone book. Each entry consists of two lines: a name and the corresponding%0D%0A * phone number.%0D%0A * %0D%0A * After these, there will be some queries. Each query will contain name of a%0D%0A * friend. Read the queries until end-of-file.%0D%0A * %0D%0A * Constraints:%0D%0A * A name consists of only lower-case English letters and it may be in the%0D%0A * format%0D%0A * 'first-name last-name' or in the format 'first-name'. Each phone number has%0D%0A * exactly 8 digits without any leading zeros.%0D%0A * %0D%0A * 1 %3C= N %3C= 104%0D%0A * 1 %3C= queries %3C= 104%0D%0A * %0D%0A * Output Format: %0D%0A * For each case, print %22Not found%22 without quotes, if the friend has no entry%0D%0A * in the phone book. Otherwise, print the friend's name and phone number. See%0D%0A * sample output for the exact format.%0D%0A * %0D%0A * To make the problem easier, we provided a portion of the code in the editor.%0D%0A * You can either complete that code or write completely on your own.%0D%0A * %0D%0A * Sample Input: %0D%0A * 3%0D%0A * sam%0D%0A * 99912222%0D%0A * tom%0D%0A * 11122222%0D%0A * harry%0D%0A * 12299933%0D%0A * sam%0D%0A * edward%0D%0A * harry%0D%0A * %0D%0A * Sample Output: %0D%0A * sam=99912222%0D%0A * Not found%0D%0A * harry=12299933%0D%0A */%0D%0Apublic class DictionariesAndMaps %7B%0D%0A%0D%0A    public static void main(String %5B%5Dargs) %7B%0D%0A        %0D%0A        Scanner in = new Scanner(System.in);%0D%0A        int n=in.nextInt();%0D%0A        in.nextLine();%0D%0A        Map%3CString, Integer%3E pb = new HashMap%3C%3E();%0D%0A        %0D%0A        for(int i=0;i%3Cn;i++) %7B%0D%0A      %0D%0A            String name=in.nextLine();%0D%0A            int phone=in.nextInt();%0D%0A            pb.put(name, phone);%0D%0A            %0D%0A            in.nextLine();%0D%0A        %7D%0D%0A        %0D%0A        while(in.hasNext()) %7B%0D%0A        %0D%0A            String s=in.nextLine();%0D%0A            %0D%0A            if (pb.containsKey(s)) %7B%0D%0A            %09System.out.println(s + %22=%22 + pb.get(s));%0D%0A            %7D else %7B%0D%0A            %09System.out.println(%22Not found%22);%0D%0A            %7D%0D%0A        %7D%0D%0A        in.close();%0D%0A    %7D%0D%0A%7D

Add DictionariesAndMaps