Hackerrank 30 days of code Java Solution: Day 8: Dictionaries and Maps

So for the day 8 of code we have a quite an interesting problem. I would recommend to watch the tutorial for this day for better understanding of Maps.

Task
Given names and phone numbers, assemble a phone book that maps friends’ names to their respective phone numbers. You will then be given an unknown number of names to query your phone book for. For each queried, print the associated entry from your phone book on a new line in the form name=phoneNumber; if an entry for is not found, print Not found instead.

Note: Your phone book should be a Dictionary/Map/HashMap data structure.

Sample Input

Sample Output

Hope you have tried by yourself and than finally you have landed here for the solution 🙂

Hope you like the post.

Leave a Reply

Your email address will not be published. Required fields are marked *