doujiang's recent timeline updates
doujiang

doujiang

V2EX member #183531, joined on 2016-07-25 10:05:33 +08:00
doujiang's recent replies
@WenjieYe 圆锥曲线要命
@darkTianTian 同学给我看过牛客网的一些题目,感觉它数据很弱,leetcode 更靠谱一些
@darkTianTian 令 M = list(matrix),查找的字符串为`abcd`,那么匹配到 ab 之后,搜索 b 的方位是右左上下,假设右不匹配 c 返回 False,此时 b 的右边会被修改为'-',但是返回上一层查找 b 的左时,右边应该恢复原状。
```
def spread(matrix, rows, cols, path, i, j):
if not path:
return True
tmp = matrix[i*cols + j]
matrix[i*cols + j] = '-'
****
matrix[i*cols + j] = tmp
return up or down or left or right
```
测试样例确实弱,应该回溯;另外,返回结果之前,应该恢复`matrix[i*cols + j]`中的内容吧?
Oct 17, 2018
Replied to a topic by syahd 全球工单系统 如何用正确的姿势投诉小米
不管如何,这种事故还是挺严重的,顶楼主
Dec 28, 2017
Replied to a topic by mingyun 生活 如何一个词形容你的 2017
宠辱不惊
Dec 24, 2017
Replied to a topic by IC0ZB 程序员 程序员的一生要经历多少苦难?救救我吧
老哥挺住,计算机毕业就是大佬了,这几年还能捞一波钱就走,来日方长
Oct 6, 2017
Replied to a topic by Antidictator 程序员 老铁们回程的票买到了吗?
实在不行可以考虑机票
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1173 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 23:21 · PVG 07:21 · LAX 16:21 · JFK 19:21
♥ Do have faith in what you're doing.