Available question text
Return the sum, over all non-empty contiguous subarrays of nums, of the square of the number of distinct values in each subarray. The core challenge is counting distinct elements per subarray; with n ≤ 100 (values ≤ 100) brute-force enumeration of subarrays is acceptable.
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 2913. Subarrays Distinct Element Sum of Squares I
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source