코딩 테스트/Codility (12) 썸네일형 리스트형 Codility CyclicRotation JavaScript 풀이 https://app.codility.com/programmers/lessons/2-arrays/cyclic_rotation/ CyclicRotation coding task - Learn to Code - Codility Rotate an array to the right by a given number of steps. app.codility.com 내가 실제로 제출한 코드는 아래와 같다. function solution(A, K) { // write your code in JavaScript (Node.js 8.9.4) if (!A || A.length === 0) return A; for (var i = 0 ; i < K ; i++) { A.unshift(A.pop()); } return A; }.. Codility BinaryGap JavaScript 풀이 https://app.codility.com/programmers/lessons/1-iterations/binary_gap/ BinaryGap coding task - Learn to Code - Codility Find longest sequence of zeros in binary representation of an integer. app.codility.com 내가 실제로 제출한 코드는 아래와 같다. function solution(N) { // write your code in JavaScript (Node.js 8.9.4) N = N.toString(2); var Narr = N.match(/(0+)(?:1+)/g) var result = (Narr == null) ? 0 : Narr.sort.. 이전 1 2 다음