Design a browser history. You start on the homepage, and you can visit new URLs, move back, and move forward.
visit(url)navigates tourlfrom the current page and clears all forward history.back(steps)moves backstepspages in history. If you can only move back fewer thanstepspages, stop at the oldest page. Returns the current url after moving.forward(steps)moves forwardstepspages. If you can only move forward fewer thanstepspages, stop at the newest page. Returns the current url after moving.
Implement the function browserHistory(homepage, operations) where homepage is the starting url and operations is a list of [op, ...args]: ["visit", url], ["back", steps], ["forward", steps]. For "visit" return null; for "back" and "forward" return the current url. Return the list of results, one per operation (use null for operations that return nothing).