liqueur's recent timeline updates
liqueur

liqueur

V2EX member #119127, joined on 2015-05-27 14:06:30 +08:00
liqueur's recent replies
Mar 22, 2018
Replied to a topic by RicardoScofileld Python 今天面试的一道算法题,求教
@liqueur 哇 v2 的代码支持不行啊
Mar 22, 2018
Replied to a topic by RicardoScofileld Python 今天面试的一道算法题,求教
N = [1, 2, 3, 4, 5]
M = 3
'''
output = [{1,2,3}{1,2,4},{1,2,5},{2,3,4},{2,3,5}{3,4,5}]
'''

output = []

for ix, x in enumerate(N):
for iy, y in enumerate(N[ix + 1:]):
for iz, z in enumerate(N[iy + 1:]):
if(y - x) == 1 and z > y:
output.append({x, y, z})

print(output)
家里有个青轴高键帽的机械键盘 入手时 699 元 后来感觉用来写代码好累啊 于是换回了 87 元的地摊双飞燕 感觉好多了 2333
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2895 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 06:21 · PVG 14:21 · LAX 23:21 · JFK 02:21
♥ Do have faith in what you're doing.