Skip to content

Instantly share code, notes, and snippets.

View rjvitorino's full-sized avatar

Ricardo Vitorino rjvitorino

View GitHub Profile
@rjvitorino
rjvitorino / only_evens.py
Last active July 13, 2024 17:52
Cassidoo's interview question of the week: a function that takes an array of integers and returns a new array containing only the even numbers, and sorted.
from typing import List
def only_evens(numbers: List[int]) -> List[int]:
"""
Returns a sorted list of even numbers from the input list.
Args:
numbers (list of int): List of integers.
Returns:
list of int: Sorted list of even integers.