TOPIC

Runtime Error - Help me

Vinicius casimiro asked 1 year ago

# -*- coding: utf-8 -*-

a = int(input())
diamonds = 0
maior = 0
menor = 0
lst = []

for i in range(a):
    b = input()

    for n in b:
        if n == "<" or n == ">":
            lst.append(n)
    print(lst)
    for j in b:
        if b[0] == ">":
            lst.pop(0)
        elif b[len(b) - 1] == "<":
            lst.pop(len(b) - 1)

    for m in lst:
        if m == ">":
            maior += 1
        elif m == "<":
            menor += 1

    if menor > maior:
        print(maior)
    else:
        print(menor)

    lst = []
    menor = 0
    maior = 0

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.