- For the second point you could try converting (a copy of) the number to a character array & test each digit individually.
- s < 1e19
- use modulus
Good luck, concentrate on doing one point at a time, not worrying about the limitations, then optimise.