Thursday, September 4, 2025
HomeData Modelling & AIPuzzle | Disclosing Secret

Puzzle | Disclosing Secret

Problem Statement: A secret can be told only to 2 persons in 5 minutes. The same person tells to 2 more persons and so on. So How long will take to spread a secret to 768 persons?

Solution:
In the beginning, let only 1 person know the secret.

  1. Now, this 1 person will tell disclose the secret to 2 other persons in 5 mins. (Secret known = 2, Remaining = 766 persons)
  2. Now, this 2 person will tell disclose the secret to 4 other persons in 5 mins. (Secret known = 4, Remaining = 764 persons)
  3. Now, this 4 person will tell disclose the secret to 8 other persons in 5 mins. (Secret known = 8, Remaining = 760 persons)
  4. Now, this 8 person will tell disclose the secret to 16 other persons in 5 mins. (Secret known = 16, Remaining = 752 persons)
  5. Now, this 16 person will tell disclose the secret to 32 other persons in 5 mins. (Secret known = 32, Remaining = 736 persons)
  6. Now, this 32 person will tell disclose the secret to 64 other persons in 5 mins. (Secret known = 64, Remaining = 704 persons)
  7. Now, this 64 person will tell disclose the secret to 128 other persons in 5 mins. (Secret known = 128, Remaining = 640 persons)
  8. Now, this 128 person will tell disclose the secret to 256 other persons in 5 mins. (Secret known = 256, Remaining = 512 persons)
  9. Now, this 256 person will tell disclose the secret to 512 other persons in 5 mins. (Secret known = 512, Remaining = 256 persons)
  10. Now, as only 256 persons are left for the secret to being known, therefore, this 512 person will tell disclose the secret to only 1 person each i.e. 256 other persons in 2.5 mins. (Secret known = 768, Remaining = 0 persons)

Total time taken = 9 * 5 + 1 * 2.5 = 47.5 mins

Therefore, total time taken to disclose the secret to 768 persons = 47.5 minutes

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

RELATED ARTICLES

Most Popular

Dominic
32261 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11795 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6747 POSTS0 COMMENTS
Ted Musemwa
7023 POSTS0 COMMENTS
Thapelo Manthata
6695 POSTS0 COMMENTS
Umr Jansen
6714 POSTS0 COMMENTS