Problem 2913 · Easy

Subarrays Distinct Element Sum of Squares I

Fix a start index, extend the end index one element at a time, and add the squared count of distinct values.

Open the interactive visualisation