JavaScript554 [Codewars] Get the mean of an array (8 kyu) / JavaScript DESCRIPTION: It's the academic year's end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to calculate their average for them. Easy ! You just need to write a script. Return the average of the given array rounded down to its nearest integer. The array will never be empty. 코드 function getAverage(marks){ return Math.floor(marks.r.. 2023. 2. 22. [백준] 25501: 재귀의 귀재 / Node.js (JavaScript) https://www.acmicpc.net/problem/25501 25501번: 재귀의 귀재 각 테스트케이스마다, isPalindrome 함수의 반환값과 recursion 함수의 호출 횟수를 한 줄에 공백으로 구분하여 출력한다. www.acmicpc.net 문제 정휘는 후배들이 재귀 함수를 잘 다루는 재귀의 귀재인지 알아보기 위해 재귀 함수와 관련된 문제를 출제하기로 했다. 팰린드롬이란, 앞에서부터 읽었을 때와 뒤에서부터 읽었을 때가 같은 문자열을 말한다. 팰린드롬의 예시로 AAA, ABBA, ABABA 등이 있고, 팰린드롬이 아닌 문자열의 예시로 ABCA, PALINDROME 등이 있다. 어떤 문자열이 팰린드롬인지 판별하는 문제는 재귀 함수를 이용해 쉽게 해결할 수 있다. 아래 코드의 isPalind.. 2023. 2. 21. [Codewars] Array plus array (8 kyu) / JavaScript https://www.codewars.com/kata/5a2be17aee1aaefe2a000151 Codewars - Achieve mastery through coding practice and developer mentorship A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages! www.codewars.com DESCRIPTION: I'm new to coding and now I want to get the sum of two arrays... Actual.. 2023. 2. 21. [백준] 2563: 색종이 / Node.js (JavaScript) https://www.acmicpc.net/problem/2563 2563번: 색종이 가로, 세로의 크기가 각각 100인 정사각형 모양의 흰색 도화지가 있다. 이 도화지 위에 가로, 세로의 크기가 각각 10인 정사각형 모양의 검은색 색종이를 색종이의 변과 도화지의 변이 평행하도록 www.acmicpc.net 문제 가로, 세로의 크기가 각각 100인 정사각형 모양의 흰색 도화지가 있다. 이 도화지 위에 가로, 세로의 크기가 각각 10인 정사각형 모양의 검은색 색종이를 색종이의 변과 도화지의 변이 평행하도록 붙인다. 이러한 방식으로 색종이를 한 장 또는 여러 장 붙인 후 색종이가 붙은 검은 영역의 넓이를 구하는 프로그램을 작성하시오. 예를 들어 흰색 도화지 위에 세 장의 검은색 색종이를 그림과 같은 모양으로.. 2023. 2. 20. 이전 1 ··· 62 63 64 65 66 67 68 ··· 139 다음