Your outer loop needs to run from
0
to the second-to-last element of the list.
Your inner loop needs to run from
outer loop + 1
to the last element of the list.
Eg:
for (int i = 0; i < list.Count - 1; i++)
{
for (int j = i + 1; j < list.Count; j++)
{
}
}
This will compare every pair of elements from the list, without comparing the same pair twice.