Between "City A" and "City B", there is a big cable which contains 100 separate wires inside it. Unfortunately, the wires are knotted together and we can't tell which head of a wire in one side (City A), belongs to which tail on the other side (City B).
The only tools that we have are:
- A power outlet
- A test light (which can be used to determine if electricity is flowing through a wire)
We can make a round-trip from City A to City B and back once.
How can we determine which endpoints belong to which wires?