I don’t understand why the need for using 2 different methods here why not just only consider the unit digits
The unit digit is the remainder only when you’re dividing by 10.