remainder_count to store the frequency of each remainder.nums:
a. Calculate the remainder of the current number when divided by space.
b. Increment the count of this remainder in remainder_count.nums and return the first number that has a remainder with the maximum frequency.