1
2
3
4
5
6
func getIntIndexValue(n, l, i int) int {
if i >= l {
panic(fmt.Sprintf("index should less than length, index %d length %d", i, l))
}
return n / int(math.Pow10(i)) % 10
}