Search
⌘K

Leetcode 3447. Assign Elements to Groups with Constraints

For each group value, return the smallest-index element j such that elements[j] divides the group (groups[i] % elements[j] == 0), or -1 if none exists; elements may be reused across groups. Arrays and values can be up to 1e5, so an efficient lookup per group is required.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.