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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Implementation
  4. Strange Counter
  5. Discussions

Strange Counter

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • sreejith_menon
    7 years ago+ 71 comments

    My simple solution of the order log n, it passed all test cases. My logic was that there was a pattern between the actual time and the time displayed on the stop watch. Am I missing something here? Many of the solutions here seem to take complex approaches.

    rem = 3
    while t > rem:
        t = t-rem
        rem *= 2
    
    print(rem-t+1)
    
    329|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy