You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/SbHCdf_c7ss
int viralAdvertising(int n) { int ans = 0, shared = 5; for(int i = 1; i <= n; i++){ ans += shared / 2; shared = (shared/2)*3; } return ans; }
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 →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/SbHCdf_c7ss