Indlæser opgaven…
Sometimes the answer depends only on the edge values of a list, while the middle does not matter. Write a function max_end3 that takes a list nums with exactly 3 numbers. Compare the first and last elements, choose the larger one, and return a list of three copies of that value.
[1, 2, 3][3, 3, 3][11, 5, 9][11, 11, 11][2, 11, 3][3, 3, 3]def max_end3(nums: list[int]) -> list[int]:
Log ind for at se indsendelseshistorik
Log indLog ind for at bruge AI-mentor
Log ind[1,2,3][3,3,3][11,5,9][11,11,11][2,11,3][3,3,3][5,2,5][5,5,5][0,0,0][0,0,0][11,9,5][11,11,11]