Retired

Funny Bargain Algorithm - PDD (retired)

11 of 18zswd89

Description:

Pinduoduo (PDD) is a popular shopping app in China that offers a unique feature: invite friends to help you bargain for a product. If enough friends join, you could get the item for free! However, the chances of reaching 100% progress and getting the item for free are slim, even with a large number of invited friends (unless you are The Chosen One).

Here’s a typical progress chart:

Invited Friends Progress
1 95%
2 97%
3 98%
4 98.5%
5 98.8%
... ...
10 99%
100 99.9%
10000 99.99%
... ...

The PDD function takes an integer input (0,2147483647), representing the count of invited friends, and returns a double output (0,1), representing the progress towards getting the item for free. The return value increases monotonically with the input parameter.

P.S.: The progress chart provided is just an illustrative example and does not need to be strictly adhered to.

Similar Kata:

Stats:

CreatedDec 6, 2023
Warriors Trained38
Total Skips5
Total Code Submissions55
Total Times Completed18
C# Completions11
JavaScript Completions13
Total Stars0
% of votes with a positive feedback rating61% of 9
Total "Very Satisfied" Votes3
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes1
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • zswd89 Avatar
Ad