can have each probe maintain a private unordered map to track all the stars it has visited. You can then iterate through this map and replicate each visited star's information to a new probe. Here's how you can do it:
The addVisitedStar method is used to add visited stars to the probe's private unordered map.
The replicateToNewProbe method takes a reference to a new probe (newProbe) as an argument and iterates through the visited stars stored in the current probe's map. For each visited star, it adds a corresponding entry to the newProbe's map using the addVisitedStar method.
By doing this, you can replicate the visited stars from one probe to another efficiently, ensuring that the new probe has the same information about the stars the original probe has visited.
can have each probe maintain a private unordered map to track all the stars it has visited. You can then iterate through this map and replicate each visited star's information to a new probe. Here's how you can do it:
In the Probe class:
The addVisitedStar method is used to add visited stars to the probe's private unordered map.
The replicateToNewProbe method takes a reference to a new probe (newProbe) as an argument and iterates through the visited stars stored in the current probe's map. For each visited star, it adds a corresponding entry to the newProbe's map using the addVisitedStar method.
By doing this, you can replicate the visited stars from one probe to another efficiently, ensuring that the new probe has the same information about the stars the original probe has visited.