[JavaScript/알고리즘] CyclicRotation (feat. 테스트 케이스)
Lesson 2 (Arrays) - CyuclicRotation(Easy) Test results - CodilityAn array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9,app.codility.com점수: 62/100 일단 코딜리티는 문제를 제출하면 코드 수정을 못하더군요.테스트 케이스를 추가하는 능력도 중..
2025. 1. 4.
[JavaScript] 코딩테스트에 유용한 자바스크립트 문법
파이썬에 이어 작성하는 자바스크립트 문법,,이번에도 필자가 몰랐던 부분 위주로 정리함.(계속 추가됨) [Python] 코딩테스트에서 알아놓으면 유용한 파이썬 문법※ 파이썬 복습 겸 필자가 몰랐던 것 위주로 정리 람다 함수(lambda x, y: x + y)(1,2) # 3(lambda li: li[1])([1,2,3]) # 2 리스트 관련elements = ["a", "b", "c"]# 리스트 요소의 인덱스elements.index("요소명")# 리스트doringri.tistory.com 리스트 관련const elements = ["a", "b", "c"];// 리스트 특정 위치에 요소 추가 및 삭제// elements.splice(인덱스, 제거할 요소의 개수, 추가할 요소들...);elements...
2024. 9. 25.