Problem 2916 · Hard

Subarrays Distinct Element Sum of Squares II

For every subarray, square its count of distinct values and add the results modulo 1000000007.

Open the interactive visualisation