Available question text
Given an array of positive integers, find a contiguous subarray that maximizes the total GCD-score defined by summing gcd(a[i], a[j]) over all unordered pairs of elements within the subarray. The challenge is to avoid O(n^2) pair checks by using number‑theory optimizations (grouping by divisors, multiplicity counting, prefix techniques) to compute contributions efficiently.
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 2941. Maximum GCD-Sum of a Subarray
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source