V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  iqhy  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2021-03-16 11:50:56 +08:00
回复了 megachweng 创建的主题 问与答 请问有没有色弱辅助 app
Color Blind Pal
2021-02-19 16:53:20 +08:00
回复了 goodboy95 创建的主题 问与答 请教 Python 快速寻找连续 1 的问题
def main2():
....res = 0
....for row in mapData:
........isOne = False
........for j, element in enumerate(row):
............if not isOne and element == 1:
................isOne = True
................res += j
............elif isOne and element == 0:
................isOne = False
................res += (j - 1)
........if isOne:
............res += j

这样遍历快一点
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5353 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 07:32 · PVG 15:32 · LAX 00:32 · JFK 03:32
Developed with CodeLauncher
♥ Do have faith in what you're doing.