getKthDigit(n, k)

getKthDigit(n, k)

Write the function getKthDigit(n, k) that takes a possibly-negative int n and a non-negative int k, and returns the kth digit of n, starting from 0, counting from the right. So:

getKthDigit(789, 0) == 9
getKthDigit(789, 1) == 8
getKthDigit(789, 2) == 7
getKthDigit(789, 3) == 0
getKthDigit(-789, 0) == 9

信息

ID
1010
难度
(无)
分类
(无)
标签
(无)
递交数
0
已通过
0
通过率
?
上传者