This question evaluates understanding of elementary number theory (divisibility rules) and algorithmic string processing for representing and reasoning about very large integers.
You are given a very large non-negative integer represented as a string s (it may be too large to fit in standard integer types).
Write a function that returns True if the number represented by s is divisible by 8, otherwise return False.
int(s)
).
s
consists only of digits
'0'
–
'9'
.
"00016"
).
s = "16"
→
True
s = "123"
→
False
s = "1000"
→
True