Skip to content

Instantly share code, notes, and snippets.

@lzdhlsc
lzdhlsc / 0_reuse_code.js
Created Dec 18, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View sliing_window_min.py
# collections.deque 如何?
# https://leetcode.com/problems/sliding-window-maximum/
dq = collections.deque() # dq keeps track of min(d[i] + a[i]) from i-1 to i-k
d[i] = dq[-1]
while len(dp) and dq[-1][0] >= d[i] + a[i]:
dq.pop()
dq.append((d[i] + a[i], i))
You can’t perform that action at this time.