{"id":16074544,"url":"https://github.com/skyv26/viral-advertising","last_synced_at":"2025-03-15T11:43:39.794Z","repository":{"id":59960338,"uuid":"540313789","full_name":"skyv26/Viral-Advertising","owner":"skyv26","description":"HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly 5 people on social media.  On the first day, half of those 5 people (i.e., floor(5/2) = 2) like the advertisement and each shares it with of their friends. At the beginning of the second day, floor(5/2) x 3 = 2 x 3 = 6 people receive the advertisement.  Each day, floor(recipients/2) of the recipients like the advertisement and will share it with 3 friends on the following day. Assuming nobody receives the advertisement twice, determine how many people have liked the ad by the end of a given day, beginning with launch day as day 1.A Hacker Rank Problem ","archived":false,"fork":false,"pushed_at":"2022-09-23T06:57:52.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T10:45:57.045Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyv26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-23T06:45:43.000Z","updated_at":"2023-02-13T09:43:32.000Z","dependencies_parsed_at":"2022-09-25T11:55:00.447Z","dependency_job_id":null,"html_url":"https://github.com/skyv26/Viral-Advertising","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyv26%2FViral-Advertising","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyv26%2FViral-Advertising/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyv26%2FViral-Advertising/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyv26%2FViral-Advertising/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyv26","download_url":"https://codeload.github.com/skyv26/Viral-Advertising/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243725540,"owners_count":20337667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T09:00:40.852Z","updated_at":"2025-03-15T11:43:39.767Z","avatar_url":"https://github.com/skyv26.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Viral-Adverstising\nA Hacker Rank Problem \n\nHackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly 5 people on social media.\n\nOn the first day, half of those 5 people (i.e., floor(5/2) = 2) like the advertisement and each shares it with  of their friends. At the beginning of the second day, floor(5/2) x 3 = 2 x 3 = 6 people receive the advertisement.\n\nEach day, floor(recipients/2) of the recipients like the advertisement and will share it with 3 friends on the following day. Assuming nobody receives the advertisement twice, determine how many people have liked the ad by the end of a given day, beginning with launch day as day 1.\n\n## Example\nn = 5\n\nDay Shared Liked Cumulative\n1      5     2       2\n2      6     3       5\n3      9     4       9\n4     12     6      15\n5     18     9      24\n\nThe progression is shown above. The cumulative number of likes on the 5th day is 24.\n\n## Function Description\nComplete the viralAdvertising function in the editor below.\n\nviralAdvertising has the following parameter(s):\n\n- int n: the day number to report\n\n### Returns\n- int: the cumulative likes at that day\n\n### Input Format\nA single integer, n , the day number.\n\n### Constraints\n\n1 \u003c= n \u003c= 50\n\n## Sample Input\n3\n\n## Sample Output\n9\n\n## Explanation\n\n![](./explanation.png)\n\n## Problem Link\n\n[Click Here](https://www.hackerrank.com/challenges/strange-advertising/problem?isFullScreen=true)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyv26%2Fviral-advertising","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyv26%2Fviral-advertising","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyv26%2Fviral-advertising/lists"}