Problem 1670 · Medium

Design Front Middle Back Queue

Split the queue into a front half and a back half that rebalance by one item, so front, middle and back operations all stay constant time.

Open the interactive visualisation