Shortest And Cleanest code with( 100.00% space efficient of Python3)
\n\nclass BrowserHistory:\n    def __init__(self, homepage: str):\n        self.hist=[homepage]\n        self.curr=0\n\n    def visit(self, url: str) -> None:\n
\n```\nclass BrowserHistory:\n    def __init__(self, homepage: str):\n        self.hist=[homepage]\n        self.curr=0\n\n    def visit(self, url: str) -> None:\n        self.hist=self.hist[:self.curr+1] #Deleting forward histories from current point and keeping the history until current point only before visiting any other url\n        self.hist.append(url)\n        self.curr+=1 #increasing self.curr to point to the current url in the history\n\n    def back(self, steps: int) -> str:\n        #we check if subtracting steps from current index results in index less than 0, then we just take the 0th element or else take (self.curr-steps)th\n        stepback=max(self.curr-steps,0)\n        self.curr=stepback\n        return self.hist[self.curr]\n\n    def forward(self, steps: int) -> str:\n\t#we check if adding stes to current index results in indexoutofboubds, then we just take thelast element or else take (self.curr+steps)th\n        stepforw=min(self.curr+steps,len(self.hist)-1)\n        self.curr=stepforw\n        return self.hist[self.curr]\n```
[]