上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: We are given the head node root of a binary tree, where additionally every node's value is either a 0 or a 1. Return the same tree where every subtree 阅读全文
posted @ 2018-07-11 16:32 Lin.B 阅读(107) 评论(0) 推荐(0)
摘要: Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temp 阅读全文
posted @ 2018-07-11 15:02 Lin.B 阅读(105) 评论(0) 推荐(0)
摘要: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twi 阅读全文
posted @ 2018-07-10 17:51 Lin.B 阅读(102) 评论(0) 推荐(0)
摘要: A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com 阅读全文
posted @ 2018-07-10 16:48 Lin.B 阅读(178) 评论(0) 推荐(0)
摘要: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals 阅读全文
posted @ 2018-07-10 16:06 Lin.B 阅读(120) 评论(0) 推荐(0)
摘要: Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the result equals B. Example 1: Input: 阅读全文
posted @ 2018-07-09 16:57 Lin.B 阅读(278) 评论(0) 推荐(0)
摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the dep 阅读全文
posted @ 2018-07-08 16:51 Lin.B 阅读(132) 评论(0) 推荐(0)
摘要: Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S = 阅读全文
posted @ 2018-07-08 16:05 Lin.B 阅读(127) 评论(0) 推荐(0)
摘要: We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文
posted @ 2018-07-05 20:42 Lin.B 阅读(99) 评论(0) 推荐(0)
摘要: 使用滑动窗口法来解决substring问题的模板如下: 这里是leetcode大神给出的通用模板,针对每个题目的不同会有一些差别。但是整体的思路就是两个指针,一个map,一个counter标记(视题目而定,也可能没有)。具体的思路就是先滑动窗口,找到一个窗口内包含一个结果;然后缩小窗口,判断结果。 阅读全文
posted @ 2018-07-05 17:14 Lin.B 阅读(130) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 下一页