DigitAt🔗
Get the digit at
index of head followed by tail.
We can not concatenate the strings, so we index into them as if they were one.
Code
if index < len(head):
return int(head[index : index + 1])
tail_index = index - len(head)
if tail_index < len(tail):
return int(tail[tail_index : tail_index + 1])
return 0