https://school.programmers.co.kr/learn/courses/30/lessons/120585
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
function solution(array, height) {
var answer = 0;
for (i=0; i<array.length; i++)
{
if (array[i]>height) {answer +=1;}
}
return answer;
}
+) 230510
const solution = (array, height) => {
return array.filter( x => x >= height).length;
}
230525 파이썬
def solution(array, height):
answer = 0
for i in array:
if i > height:
answer += 1
return answer
230915 C++
#include <string>
#include <vector>
using namespace std;
int solution(vector<int> array, int height) {
int answer = 0;
for (int i=0; i<array.size(); i++){
if (array[i]>height) answer ++;
}
return answer;
}
'코딩테스트 > LV. 0' 카테고리의 다른 글
LV. 0 :: 짝수는 싫어요 (0) | 2023.01.20 |
---|---|
LV. 0 :: 짝수 홀수 개수 (0) | 2023.01.20 |
LV. 0 :: 중앙값 구하기 (0) | 2023.01.20 |
LV. 0 :: 삼각형의 완성조건 (0) | 2023.01.20 |
LV. 1 :: 피자 나눠 먹기 1 (0) | 2023.01.20 |
댓글