Given a non-negative integer number represented as a string, which can be arbitrary large. Detect whether it is divisible by 9?
e.g
0 -> true
7 -> false
9 -> true
18 -> true
19 -> false
777777777777777777777777777777777777777777777 -> true
Tips:
- All input strings in the tests are valid non-negative integer numbers, you don't have to check that.
- You'd better not use the arbitrary-precision data types from chosen programming languages, if any, to keep the kata fun :)
- For
Java
, avoidBigInteger
orBigDecimal
. - For
Javascript
, avoidBigInt
. - For
Python3
, sinceint
has unbounded range, so avoid converting the whole input as a singleint
directly. - etc ...
- For