What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-10 13:36:03
js window history
// go back: window.history.back() // go forward: window.history.forward() // go to specific point: window.history.go(-2) // go back 2 pages, 0 is current page window.history.go(0) // refreshes current page window.history.go() // refreshes current page // ... Add solution -
-
Other 2021-09-08 14:08:02
Back button directive Angular
/** Navigation service ***/ import { Injectable } from '@angular/core' import { Location } from '@angular/common' import { Router, NavigationEnd } from '@angular/router' @Injectable({ providedIn: 'root' }) export class NavigationService { private hist... Add solution -
C++ 2021-09-06 06:48:02
monotonic deque
deque<int> dq; vector<int> ans; for (int i=0; i<nums.size(); i++) { if (!dq.empty() && dq.front() == i-k) dq.pop_front(); while (!dq.empty() && nums[dq.back()] < nums[i]) dq.pop_back(); dq.push_back(i); if (i>=k-1) ans... Add solution