- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolution.java
More file actions
Latest commit
31 lines (29 loc) · 668 Bytes
/
Copy pathsolution.java
File metadata and controls
31 lines (29 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// https://github.com/Utkarsh299-tech
importjava.util.*;
importjava.io.*;
classSolution{
publicstaticvoidmain(String []argh)
{
Scannerin = newScanner(System.in);
intn=in.nextInt();
in.nextLine();
Map<String, Integer> map = newHashMap<>();
for(inti=0;i<n;i++)
{
Stringname=in.nextLine();
intphone=in.nextInt();
in.nextLine();
map.put(name, phone);
}
while(in.hasNext())
{
Strings=in.nextLine();
if(map.containsKey(s)) {
System.out.println(s + "=" + map.get(s));
} else {
System.out.println("Not found");
}
}
in.close();
}
}