• + 1 comment
    def viralAdvertising(n):
        shared=5
        liked=shared//2
        cumu=liked
        if n<2:
            return cumu
        while n>1:
            shared=liked*3
            liked=shared//2
            cumu+=liked
            n-=1
        return cumu