• + 0 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