• + 0 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');
            }
    *     }