1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<p>每年政府都会公布一万个最常见的婴儿名字和它们出现的频率也就是同名婴儿的数量。有些名字有多种拼法例如John 和 Jon 本质上是相同的名字,但被当成了两个名字公布出来。给定两个列表,一个是名字及对应的频率,另一个是本质相同的名字对。设计一个算法打印出每个真实名字的实际频率。注意,如果 John 和 Jon 是相同的,并且 Jon 和 Johnny 相同,则 John 与 Johnny 也相同,即它们有传递和对称性。</p>
<p>在结果列表中,选择<strong> 字典序最小 </strong>的名字作为真实名字。</p>
<p> </p>
<p><strong>示例:</strong></p>
<pre>
<strong>输入:</strong>names = ["John(15)","Jon(12)","Chris(13)","Kris(4)","Christopher(19)"], synonyms = ["(Jon,John)","(John,Johnny)","(Chris,Kris)","(Chris,Christopher)"]
<strong>输出:</strong>["John(27)","Chris(36)"]</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>names.length <= 100000</code></li>
</ul>