Added 11 solutions

This commit is contained in:
rshaghoulian
2017-03-24 00:02:30 -05:00
parent 8239026cea
commit 5f4c2f4a78
26 changed files with 558 additions and 120 deletions
+5 -4
View File
@@ -4,19 +4,20 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.HashMap;
/* BufferedReader is used instead of Scanner since it's faster and
won't time out on HackerRank test cases when using Java8 */
class Solution {
public static void main(String [] args) throws Exception {
/* Read input and save as entries in a HashMap */
public static void main(String [] args) throws IOException {
/* Save input as entries in a HashMap */
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.valueOf(br.readLine());
int n = Integer.parseInt(br.readLine());
HashMap<String, Integer> map = new HashMap<>();
while (n-- > 0) {
String name = br.readLine();
int phone = Integer.valueOf(br.readLine());
int phone = Integer.parseInt(br.readLine());
map.put(name, phone);
}