Title: leetcode124-二叉树中的最大路径和 | snmlm
Open Graph Title: leetcode124-二叉树中的最大路径和
Description: 题目描述二叉树中的 路径 被定义为一条节点序列,序列中每对相邻节点之间都存在一条边。同一个节点在一条路径序列中 至多出现一次 。该路径 至少包含一个 节点,且不一定经过根节点。 路径和 是路径中各节点值的总和。 给你一个二叉树的根节点 root ,返回其 最大路径和 。 示例 1: 123输入:root = [1,2,3]输出:6解释:最优路径是 2 -> 1 -> 3 ,路径和为
Open Graph Description: 题目描述二叉树中的 路径 被定义为一条节点序列,序列中每对相邻节点之间都存在一条边。同一个节点在一条路径序列中 至多出现一次 。该路径 至少包含一个 节点,且不一定经过根节点。 路径和 是路径中各节点值的总和。 给你一个二叉树的根节点 root ,返回其 最大路径和 。 示例 1: 123输入:root = [1,2,3]输出:6解释:最优路径是 2 -> 1 -> 3 ,路径和为
Keywords:
Mail addresses
undefined
Opengraph URL: https://snmlm.github.io/algorithm/leetcode/leetcode_124/
Generator: Hexo 5.1.1
Domain: snmlm.github.io
| None | no-siteapp |
| author | snmlm |
| copyright | snmlm |
| format-detection | telephone=no |
| theme-color | #ffffff |
| og:type | article |
| og:site_name | snmlm |
| og:image | https://snmlm.github.io/img/head.gif |
| article:published_time | 2023-07-16T16:00:00.000Z |
| article:modified_time | 2023-07-17T09:35:12.714Z |
| twitter:card | summary |
Links:
Viewport: width=device-width,initial-scale=1