Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First: special casing with if solution in Clear category for Remove All After by leggewie
from typing import Iterable
def remove_all_after(items: list, border: int) -> Iterable:
if not(items and border in items):
return items
else:
return items[:items.index(border)+1]
June 3, 2021