Array
2916. Subarrays Distinct Element Sum of Squares II
The square is the whole difficulty. Drop it and you get Total Appeal of A String (2262), where every value is charged separately: each index pays for the windows in which it is the first of its kind, and the answers add up. Squaring kills that. The square of a sum keeps the cross terms between two d
Loading…