Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
39
// BrowserHistory class definition
class BrowserHistory {
constructor(url) {
this.history = [];
this.pointer = -1;
// fill in
}
visit(url) {
// fill in
}
back() {
// fill in
}
forward() {
// fill in
}
}
// Driver code to test the BrowserHistory class
const browserHistory = new BrowserHistory("https://algodaily.com");
// Visiting new URLs
browserHistory.visit("https://google.com");
browserHistory.visit("https://facebook.com");
OUTPUT
Results will appear here.