Ładowanie zadania…
The edge values of a list are often meaningful on their own, such as the start and end of a route or range. Write a function make_ends that takes a non-empty list nums. Return a new list with two elements: the first and last values from the original list.
[1, 2, 3][1, 3][1, 2, 3, 4][1, 4][7, 4, 6, 2][7, 2]def make_ends(nums: list[int]) -> list[int]:
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj się[1,2,3][1,3][1,2,3,4][1,4][7,4,6,2][7,2][5][5,5][9,9][9,9][0,0,0][0,0]