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){ | |
var answer = 0; | |
var cnt = 0, check1 = "", check2 = ""; | |
var length = []; | |
for(var i = 1; i < s.length; i++){ | |
var strCh = ""; | |
for(var j = 0; j < s.length;){ | |
check1 = s.substr(j,i); | |
check2 = s.substr(j + i, 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
function solution(priorities, location){ | |
var answer = 1; | |
var first = -1; | |
var requestIdx = location; | |
while(priorities.length > 0){ | |
first = priorities.shift(); | |
if(priorities.some((value, index) => value > first)){ | |
priorities.push(first); |
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(skill, skill_trees){ | |
var answer = 0; | |
var compare1 = "", compare2 = ""; | |
for(var i = 0; i < skill_trees.length; i++){ | |
var startIndex = 0; | |
var flag = true; | |
for(var j = 0; j < skill_trees[i].length; j++){ | |
for(var idx = startIndex; idx < skill.length; idx++){ |
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){ | |
var answer = []; | |
var check = []; | |
var bound, rest, day, temp = 0; | |
for(var i = 0; i < progresses.length; i++){ | |
rest = 100 - progresses[i]; | |
if(rest % speeds[i] == 0){ | |
day = rest / speeds[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
function solution(x, n){ | |
var answer = []; | |
var value = x; | |
for(var i = 0; i < n; i++){ | |
answer[i] = value; | |
value += x; | |
} | |
return answer; | |
} |
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(n, m){ | |
var answer = []; | |
answer[0] = solution2(n,m); | |
answer [1] = n * m / answer[0]; | |
return answer; | |
} | |
function solution2(n,m){ | |
var min = 0; |
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(n){ | |
var answer = 0; | |
answer = parseInt(String(n).split('').sort().reverse().join('')); | |
return answer; | |
} |
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,n){ | |
var answer = ""; | |
var check = ""; | |
for(var i = 0; i < s.length; i++){ | |
check = s.charCodeAt(i); | |
if(check == 32){ | |
answer += " "; | |
} | |
else if (check >= 65 && check <= 90){ | |
if(check + n > 90){ |
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){ | |
var answer = []; | |
for(var k = 0; k < arr1.length; k++){ | |
answer.push([]); | |
} | |
for(var i = 0; i < arr1.length; i++){ | |
for(var j = 0; j < arr1[i].length; j++){ | |
answer[i][j] = arr1[i][j] + arr2[i][j]; | |
} | |
} |
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(arr){ | |
var min = arr[0]; | |
var idx = 0; | |
for(var i = 1; i < arr.length; i++){ | |
if(min > arr[i]){ | |
min = arr[i]; | |
idx = i; | |
} | |
} | |
arr.splice(idx,1); |
NewerOlder