C++ || using vector || Easy-To-Understand
 # Intuition  \n\n\n\n\n\n\n\n\n\n\n\n\n# Code\n\nclass FrontMiddleBackQueue {\npublic:\n    vector<int>ans;\n    FrontMiddleBackQueue() {\n        \n    }\n   
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n<!-- # Complexity -->\n<!-- - Time complexity: -->\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n<!-- - Space complexity: -->\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass FrontMiddleBackQueue {\npublic:\n    vector<int>ans;\n    FrontMiddleBackQueue() {\n        \n    }\n    \n    void pushFront(int val) {\n        ans.insert(ans.begin(),val);\n    }\n    \n    void pushMiddle(int val) {\n        ans.insert(ans.begin()+(ans.size()/2),val);\n    }\n    \n    void pushBack(int val) {\n        ans.push_back(val);\n    }\n    \n    int popFront() {\n        if(ans.size()==0) return -1;\n         int val=ans[0];\n        ans.erase(ans.begin());\n        return val;\n    }\n    \n    int popMiddle() {\n        if(ans.size()==0) return -1;\n        int val=ans[(ans.size()-1)/2];\n        ans.erase(ans.begin()+(ans.size()-1)/2);\n        return val;\n    }\n    \n    int popBack() {\n        if(ans.size()==0) return -1;\n        int val=ans[ans.size()-1];\n        ans.pop_back();\n        return val;\n    }\n};\nif it helps plzz don\'t forget to upvote it :)\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\n```
['Queue', 'C++']