题目 Assume you are an awesome parent and want to give your children some cookies. But, you should give each chi…
分类:LeetCode
[LeetCode By Go 67]572. Subtree of Another Tree
题目 Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node valu…
260. Single Number III
260. Single Number III 题目 Given an array of numbers nums, in which exactly two elements appear only once and a…
construct-binary-tree-from-inorder-and-postorder-traversal
描述: Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that dupl…
最大单词长度乘积
给定一个字符串数组 words,找到 length(word[i]) * length(word[j]) 的最大值,并且这两个单词不含有公共字母。你可以认为每个单词只包含小写字母。如果不存在这样的两个单词,返回 0。 示…
309. Best Time to Buy and Sell Stock with Cooldown
Total Accepted: 17241 Total Submissions: 46340 Difficulty: Medium Say you have an array for which the ith elem…
76. Minimum Window Substring
76. Minimum Window Substring 题目 Given a string S and a string T, find the minimum window in S which will conta…
[LeetCode] Find Anagram Mappings 寻找异构映射
Given two lists A and B, and B is an anagram of A. B is an anag…
[LeetCode] Minimize Max Distance to Gas Station 最小化去加油站的最大距离
On a horizontal number line, we have gas stations at positions stations[0], stations[1], ..., stat…
力扣(LeetCode)3
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: “abcabcbb”…
二叉搜索树的第K个节点
题目描述 给定一颗二叉搜索树,请找出其中的第k大的结点。例如, 5 / \ 3 7 /\ /\ 2 4 6 8 中,按结点数值大小顺序第三个结点的值为4。 思路 二叉搜索树的中序遍历是按照大小顺序进行排列的,我们再中序遍…
LeetCode 21. 合并两个有序链表
题目描述 将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 输入:1->2->4, 1->3->4 输出:1->1->2->3…