Algoritim Pairwise Help - How to get indices of duplicate elements

Algoritim Pairwise Help - How to get indices of duplicate elements
0.0 0

#1

I can not sum indexes of array for the case pairwise( [1,1,1],2). Because indexOf() method only returns first duplicate element indice so I am getting sum of index is 0. How can I solve it?


#2

That’s the challenge :wink: