Company: Dp World_28aug
Difficulty: medium
Smallest Multiple Problem Description Given an integer n and a set of allowed_digits of size k , find the smallest positive multiple of n such that: Each digit of the number is present in allowed_digits . No two consecutive digits are equal. If no such number exists, return "-1" as a string. Complete the function findSmallestMultiple in the editor with the following parameters: vector<int> allowed_digits : the set of allowed digits int n : an integer Returns: string : the smallest multiple that satisfies both conditions, or "-1" if it is not possible. string findSmallestMultiple(vector<int> allowed_digits, int n) { } Examples Example 1: Input: n = 6, allowed_digits = [0, 1, 2, 3] Output: "12" Explanation: The first multiple of 6 is 6, but 6 is not in allowed_digits . The second multiple of 6 is 12, which: Uses only digits from allowed_digits (1 and 2) Has no consecutive repeated digits Therefore, return the string "12" . Example 2: Input: allowed_digits = [0, 1], n = 10 Out