We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionviralAdvertising(n){// Write your code hereletshared=5;lettotalLiked=0;for(leti=0;i<n;i++){letliked=Math.floor(shared/2);shared=(liked*3);totalLiked+=liked;}returntotalLiked;}
Cookie support is required to access HackerRank
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 →
JavaScript