1519. Number of Nodes in the Sub-Tree With the Same Label
Lc-1519
categories: [LeetCode]
tags: [DFS, BFS, medium]
1519. Number of Nodes in the Sub-Tree With the Same Label
题目大意:
给定一个被标记为从0 到n-1的n个节点的树(一个连通,无向无循环的图),根节点为0结点,
并且每个结点也被标记了小写字母,所有的结点的小写字母按照结点顺序保存在一个字符串中labels,
第i个node的字母为labels[i], 同时给定一个二维数组edges,ed
原创
2021-01-05 10:49:54 ·
137 阅读 ·
0 评论