Thread: Wonka Factory Password

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2019
    Location
    inside a singularity
    Posts
    308

    Wonka Factory Password

    http://www.hpcodewars.org/past/cw22/...ProblemSet.pdf

    Hey, so I revisited a few problems I'd left while I was solving this question set last time and I'm stuck at prob29 - Wonka Factory Password.

    How would you guys attempt to solve this @john.c and @Hodor (I mention you guys because of the interest in the ProjectEuler question you showed in one of the other threads)?

    I initially just used strings and tried solving the problem but the solution is inefficient and hard-coded, something most people can do. If you've read the question, you'll see the "At some point during the iterations, you will find that the pattern repeats but is shifted from aprevious state. Once you find this, you can predict mathematically what the final state will be. Going through the process above 50 billion times without using this shortcut will take a very long time. Your program will be marked as a PASS if it takes less than 1 minute." Well, I haven't been able to figure any mathematical hack just yet so maybe y'all can help with that. I'd like to come up with a logic with the help of you guys that I can then code out.

    I'm thinking about a different solution, something along the lines of using bits, every . is 0 and # is 1 and then try and do something with that but that's about it for my thinking. I don't know how I'd proceed further from here.....

    Thanks for your time and help!
    Last edited by Zeus_; 12-16-2019 at 11:44 AM.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook, The Wizardry Compiled

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 06-29-2014, 02:08 AM
  2. Replies: 2
    Last Post: 01-07-2009, 10:35 AM
  3. Question about the Factory pattern.
    By h3ro in forum C++ Programming
    Replies: 14
    Last Post: 11-27-2008, 04:55 PM
  4. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  5. Abstract Factory in C++
    By agrsaurabh in forum C++ Programming
    Replies: 1
    Last Post: 10-06-2003, 02:16 PM

Tags for this Thread