CodeSignal [34/60] extractEachKth
Problem: Given array of integers, remove each kth element from it. Example For inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and k = 3, the output should be extractEachKth(inputArray, k) = [1, 2, 4, 5, 7, 8, 10]. -Summary- 1. Create a 'ans' list for answer list 2. While loop을 돌리면서 index 가 지워지는 번호에 해당하지 않는경우 ans list에 넣어준다. 3. loop을 다 돌리면 지워지는 Kth index element만 지워진 'ans' list값을 return. Additional..
2020. 5. 24.