题目描述:

方法:

class Solution(object):
def findSmallestRegion(self, regions, region1, region2):
parent = {}
for row in regions:
top = row.pop(0)
for bot in row:
parent[bot] = top seen = {region1}
while region1 in parent:
region1 = parent[region1]
seen.add(region1) while region2 not in seen:
region2 = parent[region2]
return region2

最新文章

  1. asp.net pipeline完整图
  2. python爬虫学习 —— 总目录
  3. nyoj 14 会场安排问题(贪心专题)java
  4. HAST 使用笔记
  5. CodeForces ZeptoLab Code Rush 2015
  6. 设置go语言语法高亮
  7. UVaLive 7362 Farey (数学,欧拉函数)
  8. pthread_create()之前的属性设置
  9. JavaScript HTML DOM 元素(节点)
  10. Elasticsearch和MongoDB分片及高可用对比
  11. 1.MySQL(一)
  12. WCF输出JSON
  13. 转:Override vs Overload
  14. Gym101194J Mr.Panda and TubeMaster 二分图、费用流
  15. win10 大文件 安卓android studio修改 汉化
  16. PyCharm的一些设置
  17. promise 拙见
  18. (笔记)linux增加非标波特率的方法
  19. mybatise 动态sql
  20. fusionjs uber开源的通用web插件化开发框架

热门文章

  1. fiddler 4 抓取 https 设置
  2. js调用浏览器
  3. Anaconda 安装 pytorch报错解决方法
  4. jenkins安装-配置
  5. ALAsset和ALAssetRepresentation详解
  6. PHP如何进行错误与异常处理(PHP7中的异常处理和之前版本异常处理的区别)
  7. 无法在要求对象展开的函数中使用 __try
  8. (8)C++ 内存模型与名称空间
  9. (57)C# frame4 调用frame2
  10. bash arithmatic