← ALL NOTES
Array

2913. Subarrays Distinct Element Sum of Squares I

The distinct count of a subarray never shrinks as the right end moves, which turns the obvious triple loop into two loops and a 101-byte bucket array.

Loading…