Clean Python 3, O(1) in each method with dynamic array
Time: O(1) for each method\nSpace: O(N), where N is the most URLs we save\n\nclass BrowserHistory:\n\n    def __init__(self, homepage: str):\n        self.histo
Time: `O(1)` for each method\nSpace: `O(N)`, where N is the most URLs we save\n```\nclass BrowserHistory:\n\n    def __init__(self, homepage: str):\n        self.history = [homepage]\n        self.curr = 0\n        self.bound = 0\n\n    def visit(self, url: str) -> None:\n        self.curr += 1\n        if self.curr == len(self.history):\n            self.history.append(url)\n        else:\n            self.history[self.curr] = url\n        self.bound = self.curr\n\n    def back(self, steps: int) -> str:\n        self.curr = max(self.curr - steps, 0)\n        return self.history[self.curr]\n\n    def forward(self, steps: int) -> str:\n        self.curr = min(self.curr + steps, self.bound)\n        return self.history[self.curr]\n```
[]