You are viewing a single comment's thread. Return to all comments →
This is my submission in JS
let list = input.split('\n'); let phoneBook = {}; const n = parseInt(list[0]); for (let i = 1; i <= n; i++) { let [name, number] = list[i].split(' '); phoneBook[name] = number; } for (let i = n + 1; i < list.length; i++) { let name = list[i]; if (name in phoneBook) { console.log(`${name}=${phoneBook[name]}`); } else { console.log('Not found'); } * }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 8: Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
This is my submission in JS