본문 바로가기

취준8

[프로그래머스] 머쓱이보다 키 큰 사람 (lv.0) 머쓱이는 학교에서 키 순으로 줄을 설 때 몇 번째로 서야 하는지 궁금해졌습니다. 머쓱이네 반 친구들의 키가 담긴 정수 배열 array와 머쓱이의 키 height가 매개변수로 주어질 때, 머쓱이보다 키 큰 사람 수를 return 하도록 solution 함수를 완성해보세요. java class Solution { public int solution(int[] array, int height) { int answer = 0; for(int i=0; i height){ answer++; } } return answer; } } python def solution(array, height): answer = 0 for i in array: if i > height: answer += 1 return answer 2024. 1. 29.
[프로그래머스] 가채점 (lv.0) int numbers = 성적을 문의하려는 학생들의 번호 our_score = 성적을 문의하려는 학생 순서대로 담긴 정수리스트 score_list = 실제 성적이 번호 순서대로 담긴 정수리스트 solution 함수 가채점 점수 == 실제 성적 > same != > Different 파이썬 (디버깅 전) def solution(numbers, our_score, score_list): answer = [] for i in range(len(numbers)): if numbers[our_score[i]] == score_list[i]: answer.append("Same") else: answer.append("Different") return answer 파이썬 (디버깅 후) def solution(num.. 2024. 1. 22.
[프로그래머스] 산책 (lv.0) return = [동쪽으로 떨어진 거리, 북쪽으로 떨어진 거리] 자바 class Solution{ public int[] solution(String route){ int east = 0; int north = 0; int[] answer = new int [2]; for(int i=0; i 2024. 1. 22.
1/10 취업 컨설팅 보호되어 있는 글 입니다. 2024. 1. 10.