본문 바로가기

코딩테스트8

[백준] javascript - 9498번 : 시험 성적 기본적인 문제는 문제풀이 없이 Solution만 작성되어 있습니다. Title 시험 성적 Description 시험 점수를 입력받아 90 ~ 100점은 A, 80 ~ 89점은 B, 70 ~ 79점은 C, 60 ~ 69점은 D, 나머지 점수는 F를 출력하는 프로그램을 작성하시오. [ Example Input ] 첫째 줄에 시험 점수가 주어진다. 시험 점수는 0보다 크거나 같고, 100보다 작거나 같은 정수이다. 100 [ Example Output ] 시험 성적을 출력한다. A Solution const fs = require('fs') const inputData = fs.readFileSync('/dev/stdin') const a = inputData if(100>= a && a>=90){ conso.. 2020. 7. 22.
[CodeWars] javascript - 6kyu - Number Zoo Patrol 문제풀이 Title Number Zoo Patrol Description Background: You're working in a number zoo, and it seems that one of the numbers has gone missing! Zoo workers have no idea what number is missing, and are too incompetent to figure it out, so they're hiring you to do it for them. In case the zoo loses another number, they want your program to work regardless of how many numbers there are in total. Task: Write.. 2020. 5. 7.
[CodeWars] javascript - 6kyu - Difference of 2 문제풀이 Title Difference of 2 Description The objective is to return all pairs of integers from a given array of integers that have a difference of 2. The result array should be sorted in ascending order of values. Assume there are no duplicate integers in the array. The order of the integers in the input array should not matter. Examples [1, 2, 3, 4] should return [[1, 3], [2, 4]] [4, 1, 2, 3] should a.. 2020. 5. 6.
[CodeWars] javascript - 7kyu - Vowel Count 문제풀이 Title Vowel Count Description Return the number (count) of vowels in the given string. We will consider a, e, i, o, and u as vowels for this Kata. The input string will only consist of lower case letters and/or spaces. How Can I Solved 문제 요구사항 정의 함수의 인자로 문자열이 주어진다. 문자열 중에서 모음의 갯수를 구해서 반환한다. 만약, 문자열에 모음이 없는 경우에는 0을 반환한다. 모음의 종류 a, e, o, u, i 문제 접근 문제를 푸는 방법에는 크게 2가지가 있다. split() 메서드로 문자열을 나누고, in.. 2020. 5. 1.