[Python] Very simple solution using Double Linked List
\n## APPROACH : LINKED LISTS ##\n## LOGIC : GREEDY ##\n\nclass ListNode:\n    def __init__(self, x):\n        self.val = x\n        self.next = None\n        se
```\n## APPROACH : LINKED LISTS ##\n## LOGIC : GREEDY ##\n\nclass ListNode:\n    def __init__(self, x):\n        self.val = x\n        self.next = None\n        self.prev = None\n        \nclass BrowserHistory:\n\n    def __init__(self, homepage: str):\n        self.root = ListNode(homepage)\n\n    def visit(self, url: str) -> None:\n        node = ListNode(url)\n        node.prev = self.root\n        self.root.next = node\n        self.root = self.root.next\n\n    def back(self, steps: int) -> str:\n        while(steps and self.root.prev):\n            self.root = self.root.prev\n            steps -= 1\n        return self.root.val\n\n    def forward(self, steps: int) -> str:\n        while(steps and self.root.next):\n            self.root = self.root.next\n            steps -= 1\n        return self.root.val\n\n\n# Your BrowserHistory object will be instantiated and called as such:\n# obj = BrowserHistory(homepage)\n# obj.visit(url)\n# param_2 = obj.back(steps)\n# param_3 = obj.forward(steps)\n```
['Python', 'Python3']