Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function piccolo(input) {
- let parkingLIst = {}
- input.map(el => el.split(', '))
- .map(el => {if (el[0] === "IN") parkingLIst[el[1]] = el[1];
- else if (el[0] === 'OUT')delete parkingLIst[el[1]];
- });
- Object.entries(parkingLIst).sort().forEach(x => console.log(x[0]))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement