def find_friends(N, heights):stack = result = [0] * Nfor i in range(N - 1, -1, -1):while stack and heights[stack[-1]]摘要:def find_friends(N, heights):stack = result = [0] * Nfor i in range(N - 1, -1, -1):while stack and heights[stack[-1]]
来源:中国在线教育智库网