Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
b solution in Clear category for When "k" is Enough! by viktor.chyrkin
def remove_after_kth(items, k):
b = []
for i in items:
if b.count(i) < k:
b.append(i)
return b
Oct. 21, 2022