A bus company logs every trip as a tuple (from_city, to_city). It wants to know how many different routes it runs.
A route is a pair of cities, and direction doesn't matter:
("Leeds", "York") and ("York", "Leeds") are the same route.("York", "York"), isn't a route at all. Ignore it.Task: write count_routes(trips). Return the number of different routes. An empty list gives 0.