标签:amp size one sig hide each style code str
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 beextractEachKth(inputArray, k) = [1, 2, 4, 5, 7, 8, 10]
.
我的解答:
def extractEachKth(inputArray, k): return [i for i in inputArray if i not in inputArray[k - 1::k]]
def extractEachKth(inputArray, k): del inputArray[k-1::k] return inputArray
Code Signal_练习题_extractEachKth
标签:amp size one sig hide each style code str
原文地址:https://www.cnblogs.com/YD2018/p/9484481.html