☕Java Solution | 🤠 Simple Logic | 🚀beats 65% | Beginner Friendly
Problem Link : https://leetcode.com/problems/design-browser-history/\n# Approach\n Describe your approach to solving the problem. \nI have used LinkedList data 
**Problem Link :** https://leetcode.com/problems/design-browser-history/\n# Approach\n<!-- Describe your approach to solving the problem. -->\nI have used LinkedList data structure to store the `urls` and perform operation on them.\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass BrowserHistory{\n    ArrayList<String> ll = new ArrayList<>();                                              \n    int position = 0;\n    public BrowserHistory(String homepage) {\n        ll.add(homepage);\n    }\n    \n    public void visit(String url) {\n        int len = ll.size();\n        if(position+1 < len){\n            while(position+1 != len){\n                ll.remove(len-1);\n                len--;\n            }\n        }\n        position+=1;\n        ll.add(url);\n    }\n    \n    public String back(int steps) {\n        if(position - steps <= 0){\n            position = 0;\n            return ll.get(0);\n        }\n        position = position - steps;\n        return ll.get(position);\n    }\n    \n    public String forward(int steps) {\n        if(steps+position >= ll.size()){\n            position = ll.size()-1;\n            return ll.get(position);\n        }\n        position+=steps;\n        return ll.get(position);\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```
['Array', 'Java']