摘要: 问题: 给定一个二维数组,代表一块大陆的海拔, 数组左边和上边为太平洋,右边和下边为大西洋, 对于大陆上的每一个点,有水向海拔=<自己的方向流动,求既能流进太平洋,又能流进大西洋的坐标位置。 Example: Given the following 5x5 matrix: Pacific ~ ~ ~ 阅读全文
posted @ 2021-03-02 17:13 habibah_chang 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 问题: 求给定无向图(树),从那个顶点作为root,得到最矮树。 Example 1: Input: n = 4, edges = [[1,0],[1,2],[1,3]] Output: [1] Explanation: As shown, the height of the tree is 1 w 阅读全文
posted @ 2021-03-02 13:57 habibah_chang 阅读(40) 评论(0) 推荐(0) 编辑