class Solution {
public:
int findSmallestInteger(vector<int>& nums, int value) {
vector<int> v(value);
for (const int num : nums) {
++v[(num % value + value) % value];
}
int mex = 0;
while (v[mex % value] > 0) --v[mex++ % value];
return mex;
}
};