250x250
반응형
Notice
Recent Posts
Recent Comments
Link
목록shuffle (1)
N
(Leet Code JS)Shuffle An Array
https://leetcode.com/problems/shuffle-an-array/ Shuffle an Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 피셔-예이츠 셔플을 이용해 배열을 섞을 수 있다. Solution이라는 class를 이용해 reset()과 shuffle()을 구현. 생성자로는 nums 배열을 받고, original 배열을 통해 reset 시 현재 배열을 원래 배열로 되돌린다. 현재 배열의 상태는 nums라는 배열로 선언했다. r..
Leet Code 알고리즘
2022. 3. 2. 11:20