C++ || simple to understand
\nclass FrontMiddleBackQueue {\npublic:\n    deque<int> deq;\n    FrontMiddleBackQueue() {\n        \n    }\n    \n    void pushFront(int val) {\n        deq.pu
```\nclass FrontMiddleBackQueue {\npublic:\n    deque<int> deq;\n    FrontMiddleBackQueue() {\n        \n    }\n    \n    void pushFront(int val) {\n        deq.push_front(val);\n\n    }\n    \n    void pushMiddle(int val) {\n        int middle = deq.size()/2;\n        deq.insert(deq.begin()+middle,val);\n\n    }\n    \n    void pushBack(int val) {\n        deq.push_back(val);\n\n    }\n    \n    int popFront() {\n        if(deq.empty())\n        {\n \n            return -1;\n        }\n        int front = deq.front();\n        deq.pop_front();\n \n        return front;\n    }\n    \n    int popMiddle() {\n        if(deq.empty())\n        {\n\n            return -1;\n        }\n        int middle = deq.size()/2;\n        if(deq.size()%2==0)\n            middle-= 1;\n \n        int res = deq[middle];\n        deq.erase(deq.begin()+middle);\n\n        return res;\n    }\n    \n    int popBack() {\n        if(deq.empty())\n        {\n\n            return -1;\n        }\n        int pop = deq.back();\n        deq.pop_back();\n\n        return pop;\n    }\n};\n\n/**\n * Your FrontMiddleBackQueue object will be instantiated and called as such:\n * FrontMiddleBackQueue* obj = new FrontMiddleBackQueue();\n * obj->pushFront(val);\n * obj->pushMiddle(val);\n * obj->pushBack(val);\n * int param_4 = obj->popFront();\n * int param_5 = obj->popMiddle();\n * int param_6 = obj->popBack();\n */\n```
[]