Sample Input 3 sam 99912222 tom 11122222 harry 12299933 sam edward harry Sample Output sam=99912222 Not found harry=12299933 Explanation We add the following (Key,Value) pairs to our map so it looks like this: We then process each query and print key=value if the queried is found in the map; otherwise, we print Not found . Query 0: sam Sam is one of the keys in our dictionary, so we print sam=99912222 . Query 1: edward Edward is not one of the keys in our dictionary, so we print Not found . Query 2: harry Harry is one of the keys in our dictionary, so we print harry=12299933 . SOLUTION: package H acker R ank_problems . practice_problems ; import java . util .*; import java . io .*; public class TelephoneBook { public static void main ( String [] argh ){ Scanne...
Comments
Post a Comment