dominator1 [Codility] Dominator (JavaScript) https://app.codility.com/programmers/lessons/8-leader/dominator/ Dominator coding task - Learn to Code - CodilityFind an index of an array such that its value occurs at more than half of indices in the array.app.codility.com 문제:주어진 배열 중 절반 이상 등장한 원소가 있다면, 해당 원소의 인덱스를 반환. 없다면 -1 반환.내 풀이:/** * 배열 A의 원소 중 개수가 절반 이상인 원소, 즉 지배 원소가 존재하는지 검증 * * @params {number[]} A - 배열 A * @returns {number} 리더 원소 존재.. 2025. 6. 14. 이전 1 다음