본문 바로가기

전체 글56

[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.
[백준] javascript - 2739번 : 구구단 기본적인 문제는 문제풀이 없이 Solution만 작성되어 있습니다. Title 구구단 Description N을 입력받은 뒤, 구구단 N단을 출력하는 프로그램을 작성하시오. 출력 형식에 맞춰서 출력하면 된다. [ Example Input ] 첫째 줄에 N이 주어진다. N은 1보다 크거나 같고, 9보다 작거나 같다. 2 [ Example Output ] 출력형식과 같게 N*1부터 N*9까지 출력한다. 2 * 1 = 2 2 * 2 = 4 2 * 3 = 6 2 * 4 = 8 2 * 5 = 10 2 * 6 = 12 2 * 7 = 14 2 * 8 = 16 2 * 9 = 18 Solution // => 결과값 : 입력값에 따라서 구구단을 출력 const readline = require('readline'); co.. 2020. 7. 25.