Java Easy with List faster than 100%
\nclass BrowserHistory {\n    int currentIndex = 0;\n    List<String> history = new ArrayList<>();\n\n    public BrowserHistory(String homepage) {\n        hist
```\nclass BrowserHistory {\n    int currentIndex = 0;\n    List<String> history = new ArrayList<>();\n\n    public BrowserHistory(String homepage) {\n        history.add(homepage);\n    }\n    \n    public void visit(String url) {\n        // Clear the unwanted browser history\n        history.subList(currentIndex + 1, history.size()).clear();\n        history.add(url);\n        currentIndex++;\n    }\n    \n    public String back(int steps) {\n        currentIndex=Math.max(currentIndex - steps, 0);\n        return history.get(currentIndex);\n    }\n    \n    public String forward(int steps) {\n        currentIndex=Math.min(currentIndex + steps, history.size() - 1);\n        return history.get(currentIndex);\n    }\n}\n```
[]