git clone https://github.com/ishaanbuildsthings/leetcode.git
cd leetcode
python3 --version

# Bracket Sequences I のロジックを直接確認
python3 -c "
s = '(())()'
stack = 0
for c in s:
    if c == '(': stack += 1
    elif c == ')':
        if stack == 0: print('NO'); exit()
        stack -= 1
print('YES' if stack == 0 else 'NO')
"

# Movie Festival (貪欲法) のロジックを確認
python3 -c "
movies = [(1,3),(2,5),(3,7),(4,6),(6,8)]
movies.sort(key=lambda x: x[1])
count, last = 0, 0
for s, e in movies:
    if s >= last:
        count += 1
        last = e
print('最大本数:', count)
"
