You are given an integer array groups, where each element represents the size of a group, and an integer array elements.
For each group groups[i], assign the smallest index j such that elements[j] divides groups[i] with a remainder of
Return an integer array assigned of the same length as groups, where assigned[i] represents the index of the element assigned to groups[i].
Constraints:
groups.length
elements.length
groups[i]
elements[i]
You are given an integer array groups, where each element represents the size of a group, and an integer array elements.
For each group groups[i], assign the smallest index j such that elements[j] divides groups[i] with a remainder of
Return an integer array assigned of the same length as groups, where assigned[i] represents the index of the element assigned to groups[i].
Constraints:
groups.length
elements.length
groups[i]
elements[i]