974. Skillfully unraveling the chain