携程笔试编码
import sys arr = input() num = [int(n) for n in arr.split()] result=[] for i in range(len(num)): minp=num[i] n=3 for k in range(1,n+2): mina=float('inf') minb=float('inf') if k==n+1: result.append(minp) break if i+k in range(len(num)): if num[i+k]<num[i]: mina=num[i+k] if i-k in range(len(num)): if num[i-k]<num[i]: minb=num[i-k] if min(mina,minb)<minp: result.append(min(mina,minb)) break for i in result: sys.stdout.write(str(i)+" ")
通过率只有40%, 求帮分析一下哪里的问题
#笔试题目##携程#