Available question text
Find the nth positive integer divisible by a or b (i.e., multiples of a or b). Because n can be up to 1e9, use inclusion–exclusion with lcm to count how many numbers ≤ x and binary search for the smallest x with count ≥ n; return x mod 1e9+7.
Related questions
Continue with questions that share topics or the same question type.
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 878. Nth Magical Number
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source