摘要:
Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a value (int) an
阅读全文
posted @ 2025-03-28 22:04
ZhangZhihuiAAA
阅读(16)
推荐(0)
摘要:
You are given an m x n matrix board containing letters 'X' and 'O', capture regions that are surrounded: Connect: A cell is connected to adjacent cell
阅读全文
posted @ 2025-03-28 12:06
ZhangZhihuiAAA
阅读(22)
推荐(0)
摘要:
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by wa
阅读全文
posted @ 2025-03-28 08:52
ZhangZhihuiAAA
阅读(30)
推荐(0)
摘要:
Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node co
阅读全文
posted @ 2025-03-27 23:17
ZhangZhihuiAAA
阅读(15)
推荐(0)
摘要:
Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example 1: Input:
阅读全文
posted @ 2025-03-27 21:03
ZhangZhihuiAAA
阅读(23)
推荐(0)
摘要:
Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer
阅读全文
posted @ 2025-03-27 20:47
ZhangZhihuiAAA
阅读(10)
推荐(0)
摘要:
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes
阅读全文
posted @ 2025-03-27 19:46
ZhangZhihuiAAA
阅读(20)
推荐(0)
摘要:
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 only appear i
阅读全文
posted @ 2025-03-27 16:58
ZhangZhihuiAAA
阅读(32)
推荐(0)
摘要:
You are given the root of a binary tree containing digits from 0 to 9 only. Each root-to-leaf path in the tree represents a number. For example, the r
阅读全文
posted @ 2025-03-26 22:17
ZhangZhihuiAAA
阅读(14)
推荐(0)
摘要:
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the
阅读全文
posted @ 2025-03-26 17:48
ZhangZhihuiAAA
阅读(13)
推荐(0)