Given an integer array nums and an integer k, return the smallest positive multiple of k that is missing from nums. A multiple of k is any positive integer divisible by k.
Example 1
Input: nums = [8,2,3,4,6], k = 2
Output: 10
Explanation: Multiples of 2 are 2,4,6,8,10,... The set contains 2,4,6,8 but not 10, so 10 is the smallest missing multiple.
Example 2
Input: nums = [1,4,7,10,15], k = 5
Output: 5
Explanation: Multiples of 5 are 5,10,15,... 5 is not in nums, so it is the answer immediately.
Example 3
Input: nums = [1,2,3], k = 7
Output: 7
Explanation: The first multiple of 7 is 7 itself, and it is not in nums.
Drop nums into a hash set for O(1) membership, then walk the multiples of k in order — k, 2k, 3k, ... — and return the first one that isn't in the set.
Run checks all cases above. Submit evaluates all test cases.