I really enjoy writing, but I tend to write in spurts. I will get very active for a few days and then I put down my (digital) pen and paper and just walk away for a week or 20. I started writing a…
Medium
Description
Given the root
of a binary tree, find the maximum value V
for which there exists different nodes A
and B
where V = |A.val - B.val|
and A
is an ancestor of B
.
(A node A is an ancestor of B if either: any child of A is equal to B, or any child of A is an ancestor of B.)
Example 1:
Note:
找出這條路的最大最小值, 可以不用在每一次都算一次. 走到leaf算一次就可以了
以下寫法稍微精簡一點.
Debra has been a parent educator for over 30 years. She holds the title ELS, which is Early Learning Services, and ECFE, which is Early Childhood Family Education. She has an early childhood license…
Ainda lembra como nos conhecemos? O nosso primeiro e último encontro. Dia a pós dias depois daquela noite em que te ouvi refletir, cantar, jogar ping pong e depois… dançar. Fui notando o quão ficava…
Developing a product or service that stands out from the competition is hard. What is worse, with any successful product launch the competition quickly emerges. Each company is trying to grow their…