Leetcode 1670: Design Front Middle Back Queue

In this Leetcode problem, we are implementing a Queue from from with we can push and pop from the front, back, or middle.

Problem statement

Obviously, the pop and push from the middle are the core of the problem. Otherwise we could use a LinkedList.

To solve this problem, we break up the linked list into 2 linked lists. We split it in the…