HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🤎
프론트엔드 데브코스 5기 교육생
/
🐥
김은수팀
/
🏆
15주차 : 기업 코테 딱대
/
2. 베스트셀러

2. 베스트셀러

고른사람
민수
URL
https://www.acmicpc.net/problem/1302
난이도
실버4

민수 풀이

재현 풀이

송희 풀이

const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; const [n, ...books] = fs.readFileSync(filePath).toString().trim().split("\n"); let maxCount = 0; if (+n == 1) return console.log(books[0]); books.sort(); let bookName = books[0]; for (i = 0; i < books.length - 1; ) { let count = 0; while (books[i] == books[i + 1]) { count++; i++; } if (count > maxCount) { maxCount = count; bookName = books[i]; } i++; } console.log(bookName);

승민 풀이