Skip to content

Instantly share code, notes, and snippets.

View thallysrc's full-sized avatar

Thallys Rodrigues Costa thallysrc

View GitHub Profile
@thallysrc
thallysrc / return.md
Created January 19, 2023 19:00
bills to pay

Aditivo de distrato de venda / cancelamento

{
"customerName": "Tony Stark"
"cpf": "68541500004"
"personId": 21,
}

Aditivo de venda

from collections import Counter
import pytest
def brackets_analysis(string):
if len(string) % 2 != 0:
return 'invalid'
import pytest
def brackets_analysis(string: str) -> str:
pairs = {')': '(', ']': '[', '}': '{'}
stack = []
for ch in string:
if ch in pairs.values(): # opening
stack.append(ch)
elif ch in pairs: # closing