Problem 2475 · Easy

Number of Unequal Triplets in Array

Group equal values, then take each group as the middle one and multiply the entries before it, its own copies, and the entries after it.

Open the interactive visualisation