https://school.programmers.co.kr/learn/courses/30/lessons/120875
https://school.programmers.co.kr/learn/courses/30/lessons/120907
function solution(quiz) {
const correct = quiz.map(a => eval(a.split(" = ")[0]))
const result = quiz.map(a => +a.split(" = ")[1])
return result.map((a,i,arr) => a === correct[i] ? 'O' : 'X');
}
https://school.programmers.co.kr/learn/courses/30/lessons/120883
function solution(id_pw, db) {
const [id, pw] = id_pw;
const map = new Map(db);
return map.has(id) ? (map.get(id) === pw ? 'login' : 'wrong pw') : 'fail';
}
https://school.programmers.co.kr/learn/courses/30/lessons/120840
function solution(balls, share) {
let x = 1;
let y = 1;
let z = 1;
for (let i = 1; i <= balls; i++) x *= i;
for (let i = 1; i <= (balls - share); i++) y *= i;
for (let i = 1; i <= share; i++) z *= i;
return Math.round(x / (y * z));
}
✅ 소수점 오류 원인 해결하기 : https://joooing.tistory.com/entry/Javascript-%EC%86%8C%EC%88%98%EC%A0%90floating-point-%EA%B3%84%EC%82%B0-%EC%98%A4%EB%A5%98
🔈 사실 다 어렵 😫