Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- All Elements in Two Binary Search Trees
Coding
- Alternating Groups I
Coding
- Alternating Groups II
Coding · Array · Sliding Window
- Alternating Groups III
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3447. Assign Elements to Groups with Constraints
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source