A Complete Solution to The Partial Scan Problem