Rotate a list to the right by k positions. Example: [1,2,3,4,5], k=2 => [4,5,1,2,3]
Implement this function:
def rotate_right(lst: list, k: int) -> list:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: lst, k.
Input
[1, 2, 3, 4, 5]
2
Output
[4, 5, 1, 2, 3]