 
 <prompt> ```Becca, Smendrick, na PJ nwere ihe ndị na-eme ihe Magic Cards. N'ime ihe 341 kaadị. Becca nwere kaadị 12 nweta Smendrick, na Smendrick nwere ihe kaadị 3 nke PJ nwere. Kedu kaadị Becca nwere? Mepụta a python script. Function dị n'ihu.``` <response>: def solution():
    """Becca, Smendrick, and PJ have collections of Magic Cards.  There is a total of 341 cards.  Becca has 12 more than Smendrick, and Smendrick has 3 times the amount of cards that PJ has.  How many cards does Becca have?"""
    pj_cards = 0
    smendrick_cards = 0
    total_cards = 341
    becca_cards = 0
    while True:
        pj_cards += 1
        smendrick_cards = pj_cards * 3
        becca_cards = smendrick_cards + 12
        cards_left = total_cards - pj_cards - smendrick_cards - becca_cards
        if cards_left == 0:
            break
    result = becca_cards
    return result 