Skip to content

Instantly share code, notes, and snippets.

@lzdhlsc
lzdhlsc / 0_reuse_code.js
Created December 18, 2015 23:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# 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))