본문 바로가기

코딩 테스트20

[CodeWars] javascript - 6kyu : Returning Strings 기본적인 문제는 문제풀이 없이 Solution만 작성되어 있습니다. Title Returning Strings Description Make a function that will return a greeting statement that uses an input; your program should return, "Hello, how are you doing today?". [ Example Output ] 'Naver'// => "Hello, Naver how are you doing today?". 'Google'// => "Hello, Google how are you doing today?". 'Daum'// => "Hello, Daum how are you doing today?". Test C.. 2020. 8. 10.
[CodeWars] javascript - 6kyu : Will the present fit? 기본적인 문제는 문제풀이 없이 Solution만 작성되어 있습니다. Title Will the present fit? Description Santa's elves are boxing presents, and they need your help! Write a function that takes two sequences of dimensions of the present and the box, respectively, and returns a Boolean based on whether or not the present will fit in the box provided. The box's walls are one unit thick, so be sure to take that in to account... 2020. 7. 28.
[백준] javascript - 2742번 : 기찍 N 기본적인 문제는 문제풀이 없이 Solution만 작성되어 있습니다. Title 기찍 N Description 자연수 N이 주어졌을 때, N부터 1까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오. [ Example Input ] 첫째 줄에 100,000보다 작거나 같은 자연수 N이 주어진다. 5 [ Example Output ] 첫째 줄부터 N번째 줄 까지 차례대로 출력한다. 5 4 3 2 1 Solution const fs = require('fs'); const input = fs.readFileSync('/dev/stdin').toString().split(' ') const RANGE_VALUE = Number(input) for(let i=RANGE_VALUE; i>=1; i--){ conso.. 2020. 7. 27.
[백준] javascript - 2741번 : N 찍기 기본적인 문제는 문제풀이 없이 Solution만 작성되어 있습니다. Title N 찍기 Description 자연수 N이 주어졌을 때, 1부터 N까지 한 줄에 하나씩 출력하는 프로그램을 작성하시오. [ Example Input ] 첫째 줄에 100,000보다 작거나 같은 자연수 N이 주어진다. 5 [ Example Output ] 첫째 줄부터 N번째 줄 까지 차례대로 출력한다. 1 2 3 4 5 Point readline 모듈을 사용하는 경우 시간 초과...? 이 경우에는 readline 모듈을 사용할때 toString() 메서드를 사용하지 않았는지 확인해보자. 실험해본 결과 ( fs 모듈은 해당하지 않음 ) input = line.toString().split(' ') // => 시간 초과 실패 inp.. 2020. 7. 26.