You are given a non-negative integer n and a non-negative integer k. Your task is to return the number formed by rotating the digits of n to the right by k positions.
During a right rotation, the last digit moves to the front, while all other digits shift one position to the right. If k is greater than or equal to the number of digits, the rotation wraps around accordingly.
Input: n = 12345, k = 2
Output: 45123
Explanation: The last two digits, 4 and 5, move to the front, producing 45123.
Input: n = 12345, k = 5
Output: 12345
Explanation: Rotating by the full length of the number returns the original number.
Input: n = 12345, k = 1
Output: 51234
Explanation: The last digit, 5, moves to the front, producing 51234.
Sign in to write, run, and submit your solution against the full test suite.