def solution(n):
    people = 0
    total = 0
    while(True):
        total = people*(people-1)/2
        if n<total:
            break
        people+=1
    times = int(people-(total-n)-1)
    return [times,people]

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f8195d92-6c98-4e4a-a3e8-483b64a3666e/Untitled.png