Replace Last Replace Last
Elementary
English

In a given list the last element should become the first one. An empty list or list with only one element should stay the same

example

Input: List.

Output: Iterable.

Example:

replace_last([2, 3, 4, 1]) == [1, 2, 3, 4]
replace_last([1, 2, 3, 4]) == [4, 1, 2, 3]
replace_last([1]) == [1]
replace_last([]) == []