๐ป Algorithm-Coding-Test
์๊ณ ๋ฆฌ์ฆ/์๋ฃ๊ตฌ์กฐ ๋ฐ ์ฝ๋ฉํ
์คํธ ๊ณต๋ถ ์ ์ฅ์
๋งค์ผ 1~2๋ฌธ์ ๊ผญ ํ๊ณ commit ํ๊ธฐ! ๐ค
๐ Commit Message Convention
- ๋ฐฑ์ค: Add(baekjoon): ~~~ '
- ํ๋ก๊ทธ๋๋จธ์ค: Add(Level1): ~~~ '
- ์๊ณ ๋ฆฌ์ฆ: Add(greedy): ~~~ '
- ๊ตฌ๋ฆ: Add(goorm): ~~~ '
๐ฅ ์ฝ๋ฉํ
์คํธ ๋ฌธ์ ์ฌ์ดํธ
- [์ด๊ฒ์ด ์ฝ๋ฉํ
์ค๋ค-with ํ์ด์ฌ]
- Greedy(๊ทธ๋ฆฌ๋)
- Implement(๊ตฌํ)
- DFS, BFS
- Recursion(์ฌ๊ท)
- Sort(์ ๋ ฌ)
- Binary-Search(์ด์งํ์)
๐ ๋ฐฑ์ค) node.js ์
๋ ฅ๊ฐ ๋ฐ๊ธฐ
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
//์ ์ญ ๋ณ์
let input = [];
function solution() {
//ํ์ด ์ฝ๋...
}
rl.on("line", function (line) {
input.push(line);
}).on("close", function () {
//์
๋ ฅ๊ฐ ๋ฐ๋ ์ฝ๋...
solution();
})
๐ ํ๋ก๊ทธ๋๋จธ์ค) ํจ์ํ ์ฝ๋ฉํ
์คํธ
ex) Level1 - 3์ง๋ฒ ๋ค์ง๊ธฐ
function solution(n) {
const reverseTernary = n.toString(3).split('').reverse();
let answer = 0;
let sum ='';
reverseTernary.forEach(n => sum += n);
return answer = parseInt(sum, 3);
}