You are viewing a single comment's thread. Return to all comments →
Solution with recursion
def viralAdvertising(n): def rec(n, r): if n == 1: return r return r + rec(n-1, r*3//2)
return rec(n, 2)
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 →
Solution with recursion
def viralAdvertising(n): def rec(n, r): if n == 1: return r return r + rec(n-1, r*3//2)