Available question text
Count how many distinct integers g exist such that some non-empty subsequence of the given array has GCD equal to g. Input size can be up to 1e5 with values up to 2e5, so you must reason over possible gcds (typically in the range 1..max(nums)) rather than enumerating all subsequences.
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 1819. Number of Different Subsequences GCDs
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source