You are viewing a single comment's thread. Return to all comments →
Python3 O(n) solution
def viralAdvertising(n): people = 5 likes = 0 for i in range(n): people = int(people/2) likes += people people *= 3 return likes
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 →
Python3 O(n) solution