Search
⌘K

Leetcode 3336. Find the Number of Subsequences With Equal GCD

Count the number of ordered pairs of disjoint non-empty subsequences (seq1, seq2) of nums whose elements have the same GCD, returning the result modulo 10^9+7 (n ≤ 200, nums[i] ≤ 200). The core challenge is to aggregate subsequences by their GCD (bounded by 200) and combine those counts efficiently to count disjoint pairs.


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.