Basically my task is to sort a Dictionary representing cities with their population in DescendingOrder (done), but the problem comes when i have to sort two cities with equal populations by the order of receiving from the console. The function OrderByDescending seems to mess this up and my task gets wrong results.
Here is what the task requires: "If two countries/cities have the same population, keep them in the order in which they were entered."
Here is how i sort the dictionary:
cities = cities.OrderByDescending(x => x.Value).ToDictionary(a => a.Key, b => b.Value);