```
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {1,4,1,4,5,5};
int n= sizeof(arr)/sizeof(arr[0]);
int i;
cout << "The repeating elements are:" << endl;
for (i = 0; i < n; i++) {
// I have no idea how this works...
int k=abs(arr[i]);
if (arr[k] >= 0)
arr[k] = -arr[k];
else
cout << k<< " ";
}
}
```

This is the solution from a website.

I didn’t understand what exactly k returns.

your help is highly appreciated