Solution with LinkedList - TS/JS, faster than 90%
Code\n\nclass ListNode2 {\n    val: string;\n    next: ListNode2 | null;\n    prev: ListNode2 | null;\n\n    constructor(value: string, next: ListNode2 | null =
# Code\n```\nclass ListNode2 {\n    val: string;\n    next: ListNode2 | null;\n    prev: ListNode2 | null;\n\n    constructor(value: string, next: ListNode2 | null = null, prev: ListNode2 | null = null) {\n        this.val = value;\n        this.next = next;\n        this.prev = prev;\n    }\n}\n\nclass BrowserHistory {\n    list: ListNode2 | null;\n\n    constructor(homepage: string) {\n        this.list = new ListNode2(homepage);\n    }\n\n    visit(url: string): void {\n        this.list.next = new ListNode2(url, null, this.list);\n        this.list = this.list.next;\n    }\n\n    back(steps: number): string {\n        while(steps && this.list.prev) {\n            steps--;\n            this.list = this.list.prev;\n        }\n        return this.list.val;\n    }\n\n    forward(steps: number): string {\n        while(steps && this.list.next) {\n            steps--;\n            this.list = this.list.next;\n        }\n        return this.list.val;\n    }\n}\n```
['TypeScript', 'JavaScript']