V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  iqhy  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2021 年 3 月 16 日
回复了 megachweng 创建的主题 问与答 请问有没有色弱辅助 app
Color Blind Pal
2021 年 2 月 19 日
回复了 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   ·   Solana   ·   3500 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 04:46 · PVG 12:46 · LAX 20:46 · JFK 23:46
♥ Do have faith in what you're doing.