N = 8
sequence = [4, 3, 6, 8, 7, 5, 2, 1]

result = []
current = 1

for num in sequence:
    while current <= num:
        result.append('+')
        current += 1
    result.append('-')

print(result)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: