Minimum Rotations to Dial a Number II
Before dialing, you may reverse one tail of the digit string. Price every tail reversal in one sweep, since only its link into the prefix changes.
Before dialing, you may reverse one tail of the digit string. Price every tail reversal in one sweep, since only its link into the prefix changes.