Frage im Vorstellungsgespräch bei DoorDash

A Dynamic Problem that requires returning the final sequence.