This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// solution 1. | |
function solution(n) { | |
let tern = []; | |
let dec = 0; | |
do { | |
tern.push(n%3); | |
n = Math.floor(n/3); | |
} while(n>2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(arr1, arr2) { | |
const m = arr1.length; | |
const k = arr1[0].length; | |
const n = arr2[0].length; | |
let answer = []; | |
for(let i = 0; i < m; i++){ | |
let temp = []; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//onclick() 작성 시 | |
window.onclick = function(event) { | |
alert("Hello!"); | |
} | |
//addEventListener() 작성 시 | |
window.addEventListener("click", (event) => { | |
alert("Hello!"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(s){ | |
s = s.split('()').join(''); | |
const x = s.length; | |
if(s[0] == ")" || s[x-1] == "("){ | |
return false; | |
} else { | |
let cnt = 0; | |
s = s.split(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(s) { | |
s = s.split(' ').sort((a,b) => a-b); | |
let answer = [(s[0]), s[s.length-1]]; | |
return answer.join(' '); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(progresses, speeds) { | |
let answer = progresses.map((el, index) => Math.ceil((100 - el) / speeds[index])); | |
const LENGTH = answer.length; | |
let temp = []; | |
let cnt = 1; | |
let max = answer[0]; | |
for(let i = 1; i < LENGTH; i++){ | |
if(max >= answer[i]){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//solution 01 | |
function solution(n) { | |
function cnt(number) { | |
return number.toString(2) | |
.match(/1/g) | |
.length; | |
} | |
const n_cnt = cnt(n); | |
let start = n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<ul> | |
<li>apple</li> | |
<li>orange</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// solution 1 | |
function solution(answers) { | |
const submit = ["12345", "21232425", "3311224455"]; | |
function cnt(submit) { | |
const A_LENGTH = answers.length; | |
const S_LENGTH = submit.length; | |
if(A_LENGTH > S_LENGTH){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(table, languages, preference) { | |
const FIELD = ["SI", "CONTENTS", "HARDWARE", "PORTAL", "GAME"]; | |
const separate = []; | |
const count = []; | |
let answer = []; | |
for(let i of table){ | |
let temp = i.split(' '); | |
separate.push(temp.slice(1)); |
OlderNewer