跳转到指定楼层
上一主题 下一主题
收起左侧

[高频题] 记录贴,互勉

🔗
 楼主| 微信用户_b99d1cc 2023-9-10 10:04:27 | 只看该作者
全局:
138. Copy List with Random Pointer
Use map to copy the node and find the next and random new node from map.

image.png (20.74 KB, 下载次数: 4)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-10 10:23:21 | 只看该作者
全局:
200. Number of Islands
1. Find "1" in the map
2. Search all the '1' in the same island and change it to '0';
Hint: Check the bounds of the map.

image.png (30.9 KB, 下载次数: 4)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-10 11:26:22 | 只看该作者
全局:
547. Number of Provinces
Check connected use visited array

image.png (31.9 KB, 下载次数: 3)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-13 11:36:24 | 只看该作者
全局:
695. Max Area of Island

image.png (32.61 KB, 下载次数: 4)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-13 12:56:53 | 只看该作者
全局:
733. Flood Fill

image.png (31.38 KB, 下载次数: 3)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-13 14:21:26 | 只看该作者
全局:
827. Making A Large Island
1. Count area of each island and change the value, map it
2. Find the 0 and find the four different direction's island's area add them up
更多图片 小图 大图
组图打开中,请稍候......
回复

使用道具 举报

全局:
1136. Parallel Course

Topologic sort, indegree.

Only when indegree is 0, can node enque
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-18 14:48:53 | 只看该作者
全局:
1162. As Far from Land as Possible
use class to mark down the max step.

image.png (55.53 KB, 下载次数: 5)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-18 15:08:18 | 只看该作者
全局:
841. Keys and Rooms
DFS search

image.png (23.86 KB, 下载次数: 3)

image.png
回复

使用道具 举报

🔗
 楼主| 微信用户_b99d1cc 2023-9-19 01:37:53 | 只看该作者
全局:
1202. Smallest String With Swaps
union-find
更多图片 小图 大图
组图打开中,请稍候......
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表