![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leecode
huluwabeforewinter
★★★★★
展开
-
leecode每日一题77-组合
题目描述 给定两个整数 n 和 k,返回 1 … n 中所有可能的 k 个数的组合。 示例: 输入: n = 4, k = 2 输出: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] 解析 以 n=4, k=2 为例,选出组合的第一个数时,我们有 4 种选择,如下图。 选出第二个数时,本来有 4 种选择,但有的选择和上一个选择相同,有的选择会产生重复的组合,比如 [1,2] 和 [2,1]。 这些选择应该被修剪掉,原创 2020-12-20 11:16:04 · 427 阅读 · 1 评论 -
leecode每日一题417. Pacific Atlantic Water Flow (Medium)
这里写自定义目录标题题目示例求解题目的理解代码 题目 给定一个 m x n 的非负整数矩阵来表示一片大陆上各个单元格的高度。“太平洋”处于大陆的左边界和上边界,而“大西洋”处于大陆的右边界和下边界。 规定水流只能按照上、下、左、右四个方向流动,且只能从高到低或者在同等高度上流动。 请找出那些水流既可以流动到“太平洋”,又能流动到“大西洋”的陆地单元的坐标。 提示: 输出坐标的顺序不重要 m 和 n 都小于150 示例 给定下面的 5x5 矩阵: 太平洋 ~ ~ ~ ~ ~原创 2020-12-19 16:29:31 · 164 阅读 · 2 评论 -
leecode每日一题01- Binary Tree Level Order Traversal [Medium]
关于二叉树的遍历查找。 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 [3,9,20,null,null,15,7], 3 ...原创 2018-10-28 21:53:42 · 109 阅读 · 0 评论 -
leecode每日一题02- same tree[easy]
题目: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical and the nodes have the same value. Ex...原创 2018-10-28 22:10:34 · 144 阅读 · 0 评论 -
leecode每日一题03-subtree of another tree
题目描述: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of th...原创 2018-10-29 09:11:55 · 143 阅读 · 4 评论 -
leecode每日一题04 N-ary Tree Level Order Traversal
Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example, given a 3-ary tree: We should return its level order traver...原创 2019-01-05 12:08:35 · 113 阅读 · 0 评论 -
leecode每日一题05 Leaf-Similar Trees
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given tree above, the leaf value sequence is (6, 7, 4...原创 2019-01-05 20:28:07 · 122 阅读 · 0 评论