• + 0 comments

    Javascript solution

        const s = input.split("\n");
        const queue = []
        s.shift()
        s.forEach(op => {
            if(op.startsWith("1")) {
                queue.push(op.split(" ")[1])
            }
            if(op === '2') {
                queue.shift();
            }
            if(op === '3') {
                console.log(queue[0])
            }
        })