René's URL Explorer Experiment


Title: #124 - Binary Tree Maximum Path Sum - LeetCode JavaScript Solutions

Open Graph Title: #124 - Binary Tree Maximum Path Sum - LeetCode JavaScript Solutions

X Title: #124 - Binary Tree Maximum Path Sum - LeetCode JavaScript Solutions

Description: A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can onl...

Open Graph Description: A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can onl...

X Description: A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can onl...

Keywords:

Opengraph URL: https://leetcodejavascript.com/solutions/binary-tree-maximum-path-sum

direct link

Domain: leetcodejavascript.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/binary-tree-maximum-path-sum","name":"#124 - Binary Tree Maximum Path Sum - LeetCode JavaScript Solutions","description":"A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can onl...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * Definition for a binary tree node.\n * function TreeNode(val, left, right) {\n * this.val = (val===undefined ? 0 : val)\n * this.left = (left===undefined ? null : left)\n * this.right = (right===undefined ? null : right)\n * }\n */\n/**\n * @param {TreeNode} root\n * @return {number}\n */\nvar maxPathSum = function(root) {\n let result = -Infinity;\n\n function traverse(node) {\n if (!node) return 0;\n const leftValue = Math.max(traverse(node.left), 0);\n const rightValue = Math.max(traverse(node.right), 0);\n result = Math.max(result, node.val + leftValue + rightValue);\n return node.val + Math.max(leftValue, rightValue);\n }\n\n traverse(root);\n\n return result;\n};","keywords":"LeetCode 124, #124 - Binary Tree Maximum Path Sum, Hard, JavaScript solution","learningResourceType":"Code","isAccessibleForFree":true,"educationalLevel":"intermediate","interactivityType":"mixed"}

authorLeetCodeJavascript.com
og:typearticle
og:imagehttps://leetcodejavascript.com/og-image.jpg
og:site_nameLeetCode JavaScript Solutions
twitter:cardsummary_large_image
twitter:urlhttps://leetcodejavascript.com/solutions/binary-tree-maximum-path-sum
twitter:imagehttps://leetcodejavascript.com/og-image.jpg
twitter:creator@joshcrozier
theme-color#1f2937

Links:

LeetCodeJavascript.com https://leetcodejavascript.com/
Star on GitHubhttps://github.com/JoshCrozier/leetcode-javascript
Back to all solutionshttps://leetcodejavascript.com
View on LeetCode https://leetcode.com/problems/binary-tree-maximum-path-sum/
View on GitHubhttps://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/0124-binary-tree-maximum-path-sum.js
Dynamic Programming https://leetcodejavascript.com/tags/dynamic-programming
Depth-First Search https://leetcodejavascript.com/tags/depth-first-search
Tree https://leetcodejavascript.com/tags/tree
Binary Treehttps://leetcodejavascript.com/tags/binary-tree
Josh Crozierhttps://joshcrozier.com

Viewport: width=device-width,initial-scale=1

Robots: index, follow


URLs of crawlers that visited me.