LeetCode
Aopir
这个作者很懒,什么都没留下…
展开
-
LeetCode437.Path Sum III
You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but it must go downwards (traveling only from parent nodes to child原创 2020-07-19 19:09:01 · 218 阅读 · 0 评论 -
LeetCode112.Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf is a node with no children.Example:Given the below binary tree and sum = 22, 5 /原创 2020-07-19 19:07:58 · 245 阅读 · 0 评论 -
LeetCode113.Path Sum II Python实现(详细解析以及错误展示分析)
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.Note: A leaf is a node with no children.Example:Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ /原创 2020-07-19 19:06:30 · 270 阅读 · 0 评论 -
LeetCode234. Palindrome Linked List
Given a singly linked list, determine if it is a palindrome.Example 1:Input: 1->2Output: falseExample 2:Input: 1->2->2->1Output: trueExample 3:Input: 1->2->3->2->1Output: trueFollow up:Could you do it in O(n) time and原创 2020-07-16 16:58:22 · 230 阅读 · 1 评论 -
LeetCode104.Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no children.Example:Given binary tree [3,9,20,null,null,15,7],原创 2020-07-16 16:59:19 · 235 阅读 · 0 评论 -
LeetCode160. Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:begin to intersect at node c1.Example 1:Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,6,1,8,4,5], skip原创 2020-07-16 17:07:41 · 270 阅读 · 0 评论