diff --git "a/Insung-Jo/\352\260\201\353\217\204\352\270\260.js" "b/Insung-Jo/level_0/\352\260\201\353\217\204\352\270\260.js" similarity index 100% rename from "Insung-Jo/\352\260\201\353\217\204\352\270\260.js" rename to "Insung-Jo/level_0/\352\260\201\353\217\204\352\270\260.js" diff --git "a/Insung-Jo/level_0/\353\254\270\354\236\220\354\227\264 \354\225\210\354\227\220 \353\254\270\354\236\220\354\227\264.js" "b/Insung-Jo/level_0/\353\254\270\354\236\220\354\227\264 \354\225\210\354\227\220 \353\254\270\354\236\220\354\227\264.js" new file mode 100644 index 0000000..dde621e --- /dev/null +++ "b/Insung-Jo/level_0/\353\254\270\354\236\220\354\227\264 \354\225\210\354\227\220 \353\254\270\354\236\220\354\227\264.js" @@ -0,0 +1,6 @@ +function solution(str1, str2) { + if(typeof str1 !== 'string' || typeof str2 !== 'string') throw new Error('문자를 입력해주세요.'); + const result = str1.indexOf(str2) !== -1 ? 1 : 2; + + return result; +} \ No newline at end of file diff --git "a/Insung-Jo/level_0/\354\247\235\354\210\230\354\235\230 \355\225\251.js" "b/Insung-Jo/level_0/\354\247\235\354\210\230\354\235\230 \355\225\251.js" new file mode 100644 index 0000000..415098b --- /dev/null +++ "b/Insung-Jo/level_0/\354\247\235\354\210\230\354\235\230 \355\225\251.js" @@ -0,0 +1,12 @@ +function solution(n) { + if(typeof n !== 'number') throw new Error('정수를 입력해주세요.'); + if(n <= 1) return 0; + + let result = 0; + + for(let i = 2; i <= n; i+=2){ + result += i; + } + + return result; +} \ No newline at end of file