Write a function `last_digit(n: int) -> int` that takes a non-negative integer `n` and returns its last digit (the digit in the ones place). For example, the last digit of 1234 is 4, and the last digit of 0 is 0. You can assume the input is always a non-negative integer. The function should be implemented without converting `n` to a string.