Viral Like Count
An ad spreads through friends as a simple viral chain. On the first day, 5 people see it: half of them, rounded down, like it, and each person who likes it shares it with 3 new people the next day. The function viral_advertising receives the number of days n. Return the total number of likes accumulated across all days.
Примеры
Ввод
1Вывод
2Ввод
2Вывод
5Ввод
3Вывод
9Нужно реализовать
def viral_advertising(n: int) -> int:
Теги
math
Log in om je inzendingsgeschiedenis te zien
InloggenLog in om de AI-mentor te gebruiken
InloggenVisible tests
1
Input
1Expected
22
Input
2Expected
53
Input
3Expected
94
Input
5Expected
245
Input
4Expected
156
Input
-1Expected
0Focus radio
Paused · SomaFM · Fluid