# 2598. Smallest Missing Non-negative Integer After Operations ###### tags: `Leetcode` `Medium` `Math` Link: https://leetcode.com/problems/smallest-missing-non-negative-integer-after-operations/description/ ## 思路 思路参考[这里](https://leetcode.com/problems/smallest-missing-non-negative-integer-after-operations/solutions/3314226/java-c-python-count-remainders/) 所有数字对value取余 然后找到出现次数最小的余数 smallest missing non-negative integer%value的余数一定就是那个数 ## Code ```python= class Solution: def findSmallestInteger(self, nums: List[int], value: int) -> int: count = Counter(num%value for num in nums) stop = 0 for i in range(value): if count[i]<count[stop]: stop = i return value*count[stop]+stop ```