386. Smallest Missing Multiple of K

EasyHash Table

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.

Examples

Input: [8,2,3,4,6] 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.

Constraints

  • 1 <= nums.length <= 100
  • 1 <= nums[i] <= 100
  • 1 <= k <= 100
Loading...

Run checks all cases above. Submit evaluates all test cases.