Combination without repetition
I have Collection `List<Car>`.

How to compare each item from this collection with rest without repeatition.

Ex:

1. iteration:

this car is Audi and secondCar is BMW


    bool IsSimilar(Car secondCar)
    {
    if(this.Name==secondCar.Name) return true;
    return false;
    }


this is not permitted:

n iteration

this car is BMW and secondCar is Audi


    bool IsSimilar(Car secondCar)
    {
    if(this.Name==secondCar.Name) return true;
    return false;
    }
Combination without repetition
===

I have Collection `List<Car>`.

How to compare each item from this collection with rest without repeatition.

Ex:

1. iteration:

this car is Audi and secondCar is BMW


    bool IsSimilar(Car secondCar)
    {
    if(this.Name==secondCar.Name) return true;
    return false;
    }


this is not permitted:

n iteration

this car is BMW and secondCar is Audi


    bool IsSimilar(Car secondCar)
    {
    if(this.Name==secondCar.Name) return true;
    return false;
    }