I have the following code in C# which checks if items in a list are equal (a list of integers for all practical purposes):
intList.Distinct().Count() == 1
The above code works if all values in the list are equal.
However if I have a scenario where:
intList = {1, 1, 0}
then the above code fails. Can someone please suggest how I can check similar values in a list when all values in the list many not be equal.