Day 8: Dictionaries & Maps | 30 Days of Coding | HackerRank | Java Language

**Before watching this make sure that you’ve tried enough**
Language: Java 7

//Complete this code or write your own from scratch
import java.util.*;

class Solution{
    public static void main(String []argh){
        Scanner in = new Scanner(;
        int n = in.nextInt();
        Map<String, String> hmap = new HashMap<String, String>();
        for(int i = 0; i < n; i++){
            String name =;
            int phone = in.nextInt();
            // Write code here
            //putting values into map
            String s =;
            // Write code here
            else System.out.println("Not found");


If this solution helped you, please share this with your friends.
And if you have anything to say, let me know in the comment section.
More solutions are coming so Like our Facebook page and Subscribe to our YouTube channel to stay connected.

Leave a Comment