Problem :
Given the root of a binary tree, determine if it is a valid binary sea...
這一題其實以前就有寫過,只是當時還不知道Two Pointer的解題技巧,也是用迴圈粗暴解決,後來為了想要刻意練習使用Two Pointer技巧,又再重寫一次題...
58. Length of Last Word
題目描述:
給定一個只包含大小寫字母和空格 ' ' 的字符串 s,返回其最後一個單詞的長度。如果字符串尾部包含空...
MediumRelated Topics: Hash Table / String / Greedy / Sorting / CountingLeetCode...
題目
1367. Linked List in Binary Tree難度: 中等偏難
題意
給定一串連鏈接head及一二元樹root,求head是否存在於二元...
112. Path Sum
题目描述:
給定一個二元樹的根節點 root 和一個整數 targetSum,判斷該樹中是否存在從根節點到葉子節點的路徑,使得這條路...