You are viewing a single comment's thread. Return to all comments →
def viralAdvertising(n): liked = 2 cumulative = 2 shared = 5 for i in range(n-1): shared = liked*3 liked = shared//2 cumulative += liked return cumulative
Seems like cookies are disabled on this browser, please enable them to open this website
Viral Advertising
You are viewing a single comment's thread. Return to all comments →
def viralAdvertising(n): liked = 2 cumulative = 2 shared = 5 for i in range(n-1): shared = liked*3 liked = shared//2 cumulative += liked return cumulative