C++ | Array | Easy approach
\nclass BrowserHistory {\npublic:\n    string history[105] = {};\n    int idx = 0;\n    int end = 0;\n    \n    BrowserHistory(string homepage) {   \n        hi
```\nclass BrowserHistory {\npublic:\n    string history[105] = {};\n    int idx = 0;\n    int end = 0;\n    \n    BrowserHistory(string homepage) {   \n        history[idx] = homepage;\n    }\n    \n    void visit(string url) {\n        history[++idx] = url;\n        end = idx;\n    }\n    \n    string back(int steps) {\n        idx = max(idx - steps, 0);\n        return history[idx];\n    }\n    \n    string forward(int steps) {\n        idx = min(idx + steps, end);\n        return history[idx];\n    }\n};\n\n/**\n * Your BrowserHistory object will be instantiated and called as such:\n * BrowserHistory* obj = new BrowserHistory(homepage);\n * obj->visit(url);\n * string param_2 = obj->back(steps);\n * string param_3 = obj->forward(steps);\n */\n```\n\nExplanation:\n1. For moving back and front we just have to validate if we have enough steps to move in the required direction and adjust accordingly\n2. The bit complicated case is of when we are visiting a new URL, I just save the current end of the array in order to clear the forward history
['Array', 'C']