var tag_list = [
    ["array", "Array"],
    ["string", "String"],
    ["queue_stack", "Queue/Stack"],
    ["heap", "Heap"],
    ["linked_list", "Linked list"],
    ["binary_search", "Binary search"],
    ["sort", "Sort"],
    ["graph", "Graph"],
    ["hashmap", "Hashmap"],
    ["backtrack", "Backtrack"],
    ["dfs", "DFS"],
    ["bfs", "BFS"],
    ["tree", "Tree"],
    ["trie", "Trie"],
    ["two_pointers", "Two pointers"],
    ["fast_slow_pointers", "Fast/Slow pointers"],
    ["sliding_window", "Sliding window"],
    ["prefix_sum", "Prefix sum"],
    ["bit", "Bit manipulation"],
    ["dp", "Dynamic programming"],
    ["union_find", "Union find"],
    ["topo_sort", "Topological sort"],
    ["segment_tree", "Segment tree"],
    ["line_sweep", "Line sweep"]
];

var templates = {
    "bfs": "/template/bfs",
    "dfs": "",
    "binary_search": "",
    "backtrack": "",
    "topo_sort": "",
    "cycle_sort": "",
    "quick_sort": "",
    "merge_sort": "",
    "reverse_list": "",
    "sliding_window": "",
};

var problems = {
    "1": {
        name: "1. Two Sum",
        tags: ["array", "hashmap"],
        keywords: ["two sum"],
        url: "/leetcode/1-two-sum",
        notes: "hashmap, T: O(N), S: O(N)",
        templates: [],
        companies: ["bloomberg", "amazon"],
    },
    "2": {
        name: "2",
        tags: ["array", "string"],
        keywords: ["change coin"],
        url: "some link",
        notes: "quick note",
    },
    "3": {
        name: "3",
        tags: ["array", "string", "tree"],
        keywords: ["N queens"],
        url: "some link",
        notes: "quick note",
    },
    "4": {
        name: "4",
        tags: ["string", "tree"],
        keywords: ["two sum"],
        url: "some link",
        notes: "quick note",
    },
    "5": {
        name: "5",
        tags: ["tree"],
        keywords: ["two sum"],
        url: "some link",
        notes: "quick note",
    },
    "46": {
        name: "46. permutations",
        url: "/leetcode/46-permutations",
        tags: ["backtrack"],
        keywords: ["permutation"],
        template: ["backtrack"],
        notes: "Backtrack template. End condition: path=nums[:i]+nums[i+1:]. res.append([nums[i]] + path]) Time: O(N!), Space: O(N!)",
    },
    "51": {
        name: "51. N queens",
        url: "/leetcode/51-n-queens",
        tags: ["backtrack"],
        keywords: ["N queens"],
        template: ["backtrack"],
        notes: "Backtrack template. bt(grid, 0). End condition: row==len(grid). diag_l[row+col], diag_r[col-row+n-1], grid[row][col]='Q';bt();grid[row][col]='.'. Time: O(N!), Space: O(N!)",
    },
    "76": {
        name: "76. Minimum Window Substring",
        url: "/leetcode/51-n-queens",
        tags: ["backtrack"],
        keywords: ["N queens"],
        template: ["backtrack"],
        notes: "Backtrack template. bt(grid, 0). End condition: row==len(grid). diag_l[row+col], diag_r[col-row+n-1], grid[row][col]='Q';bt();grid[row][col]='.'. Time: O(N!), Space: O(N!)",
    },
    "111": {
        name: "111. Minimum Depth of Binary Tree",
        url: "/leetcode/111-minimum-depth-of-binary-tree",
        tags: ["bfs", "tree"],
        keywords: ["tree depth"],
        template: ["bfs"],
        notes: "BFS template. deque. level traverse. range(len(que)), add children to next level.",
    },
    "141": {
        name: "141. Linked List Cycle",
        url: "/leetcode/141-linked-list-cycle",
        tags: ["fast_slow_pointers", "linked_list"],
        keywords: ["cycle list"],
        template: ["fast_slow_pointers"],
        notes: "Fast/Slow pointers, T:O(N), S:O(1)",
    },
    "142": {
        name: "142. Linked List Cycle II",
        url: "/leetcode/142-linked-list-cycle-ii",
        tags: ["fast_slow_pointers", "linked_list"],
        keywords: ["cycle list"],
        template: ["fast_slow_pointers"],
        notes: "Fast/Slow pointers, 先找到meetpoint，再从头同步前进直到相遇。T:O(N), S:O(1)",
    },
    "167": {
        name: "167. Two Sum II - Input array is sorted",
        tags: ["array", "two_pointers"],
        keywords: ["two sum", "sorted"],
        url: "/leetcode/167-two-sum-ii-input-array-is-sorted",
        notes: "Two pointers, T: O(N), S: O(N)",
        templates: ["two_pointers"],
        companies: ["bloomberg", "amazon"],
    }, 
    "322": {
        name: "322. coin change",
        url: "/leetcode/322-coin-change",
        tags: ["dp"],
        keywords: ["coin change"],
        template: ["dp"],
        notes: "topdown: res = min(res,sub_res+1), bottomUp: dp[i]=min(dp[i],dp[i-coin]+1). Time: O(amount*N), Space: O(amount)",
    },
    "560": {
        name: "560. subarray sum equals k",
        tags: ["array", "hashmap", "prefix_sum"],
        keywords: ["subarray", "sum"],
        url: "/leetcode/560-subarray-sums",
        notes: "get prefix sum for array, use hashamp as two-sum searching presum[i]-k time: O(N)",
    },
    "752": {
        name: "752. Open the Lock",
        url: "/leetcode/752-open-the-lock",
        tags: ["bfs",],
        keywords: ["lock"],
        template: ["bfs"],
        notes: "BFS template. deque. level traverse. range(len(que)), add children to next level.",
    },
};

@@ -2698,35 +2698,51 @@
  %22/leetcode/
-51-n-queens
+76-minimum-window-substring
 %22,%0A        t
@@ -2744,33 +2744,38 @@
     tags: %5B%22
-backtrack
+sliding_window
 %22%5D,%0A        
@@ -2782,32 +2782,48 @@
 keywords: %5B%22
-N queens
+minimum window%22, %22string
 %22%5D,%0A        
@@ -2830,33 +2830,38 @@
 template: %5B%22
-backtrack
+sliding_window
 %22%5D,%0A        
@@ -2872,152 +2872,72 @@
 s: %22
-Backtrack template. bt(grid, 0). End condition: row==len(grid). diag_l%5Brow+col%5D, diag_r%5Bcol-row+n-1%5D, grid%5Brow%5D%5Bcol%5D='Q';bt();grid%5Brow%5D%5Bcol%5D='.'
+Sliding window template. while increase right, while shrink left
 . Ti
@@ -2934,34 +2934,35 @@
 k left. Time: O(
-N!
+S+T
 ), Space: O(N!)%22
@@ -2949,34 +2949,35 @@
 (S+T), Space: O(
-N!
+%7CS%7C
 )%22,%0A    %7D,%0A    %22

add sliding window to tag search