How do I solve this? I kinda am confused if its a binary search problem of just have to precompute a vectors with numbers whose last digit is not 0?