Medium
You have a browser with one tab starting on a homepage. Implement BrowserHistory(homepage), visit(url) (visits url from the current page and clears all forward history), back(steps) (move back up to steps pages, return the current url), and forward(steps) (move forward up to steps pages, return the current url).
Input: operations = ["BrowserHistory","visit","visit","visit","back","back","forward","visit","forward","back","back"], values = [["leetcode"],["google"],["facebook"],["youtube"],[1],[1],[1],["linkedin"],[2],[2],[7]] Output: [null,null,null,null,facebook,google,facebook,null,linkedin,google,leetcode]