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.
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.