Feladat betöltése…
Shifting a list is like a carousel: the first element moves to the end, and everything else moves one position to the left. Write a function shift_left that takes a list nums and returns a new list after this shift. If the list has one element, it stays the same.
[1, 2, 3][2, 3, 1][1, 2][2, 1][1][1]def shift_left(nums: list[int]) -> list[int]:
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
Bejelentkezés[1,2,3][2,3,1][1,2][2,1][1][1][][][5,6,7,8][6,7,8,5][2,1][1,2]