62. Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 动态规划 Leetcode 2019年11月08日 30次浏览

102. Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree [ Leetcode 2019年10月30日 34次浏览

10. Regular Expression Matching

class Solution { public boolean isMatch(String s, String p) { int m = s.length(); int n = p.length(); boolean[][] dp = new Leetcode 动态规划 2019年10月30日 48次浏览


前言 窗口法(sliding window)是面试当中的高频题,主要考虑指针变化以及窗口移动的条件。然而由于细节比较多,经常出现有思路却写不出的情况,在本篇文章中尝试对大部分的窗口法题目做一个总结,提取一个或者多个模板。强化记忆。 窗口法的题目的核心思想其实就是双指针的移动,这类题目常见于字符串 Leetcode 窗口法 2019年10月26日 57次浏览

904. Fruit Into Baskets

原题链接 In a row of trees, the i-th tree produces fruit with type tree[i]. You start at any tree of your choice, then repeatedly perform the following 窗口法 Leetcode 2019年10月26日 41次浏览

567. Permutation in String

原题链接 Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's pe Leetcode 窗口法 2019年10月24日 42次浏览

992. Subarrays with K Different Integers

原题链接 Given an array A of positive integers, call a (contiguous, not necessarily distinct) subarray of A good if the number of different integers in Leetcode 窗口法 2019年10月24日 46次浏览

480. Sliding Window Median

原题链接 Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of Leetcode 窗口法 2019年10月24日 41次浏览

424. Longest Repeating Character Replacemen

Given a string s that consists of only uppercase English letters, you can perform at most k operations on that string. In one operation, you can choos Leetcode 窗口法 2019年10月23日 42次浏览

1235. Maximum Profit in Job Scheduling

We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i]. You're given the startTime , Leetcode 动态规划 2019年10月20日 102次浏览