Algorithm쇠막대기problem number: 10799link: https://www.acmicpc.net/problem/10799Define input, outputInput: 쇠 막대기의 시작, 끝, 레이저 포인트에 대한 arrayOutput: 레이저로 잘린 쇠막대기의 총 개수source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 import sys points = list(sys.stdin.readline().strip()) total = 0 remain = [] for i, point in enumerate(points): if point == ")": j = remain.pop() if i - j == 1: total += len(remain) else: total += 1 else: remain.append(i) print(total)```