challenges

my solutions to various "programming challenge" problems
git clone https://wehaveforgeathome.hates.computer/challenges.git
Log | Files | Refs | LICENSE

README.md (3101B)


      1     Source: http://hyperpublic.com/challenge/question1
      2 
      3     Hyperpublic Challenge - Problem 1
      4 
      5     Hyperpublic users can add their friends by emailing a photo of them to add@hyperpublic.com. We want to determine a user’s influence on the system by determining how many users he is responsible for. A user’s influence is calculated by giving him 1 point for every user he’s added in addition to the sum of the influence scores of each user that he’s added.
      6 
      7     Example: User 0 adds User 1 and User 2. User 1 adds User 3.
      8 
      9     User 0’s influence score is 3. (He added two users and one of them added added a third user.)
     10     User 1's is 1.
     11     User 2’s is 0.
     12     User 3’s is 0.
     13 
     14     The above scenario is represented by the following input file. Line i is user ID i and position j within the line is marked with an X if user ID i added user ID j. Both row and column indicies are 0-based:
     15 
     16      OXXO
     17      OOOX
     18      OOOO
     19      OOOO
     20 
     21     Use the input file here to determine what the highest influence score is among 100 random Hyperpublic users. To compute the answer to problem 1, append the top 3 influence totals together in descending order. (For example if they are 17, 5, and 3 then submit 1753)
     22 
     23     You've passed Problem 1. You're half way there. Try Problem 2.
     24 
     25     Hyperpublic has an internal karma system to determine which users are the most involved in the ecosystem. Users earn points for the following tasks.
     26 
     27     2 Points – Add Place
     28     3 Points – Add Thing
     29     17 Points – Tag Object
     30     23 Points – Upload Photo
     31     42 Points – Twitter Share
     32     98 Points – Facebook Share
     33     Being addicted to their own product, the Hyperpublic staff has racked up some big karma. The members of the team have the following karma totals:
     34 
     35     Doug – 2349 points
     36     Jordan – 2102 points
     37     Eric – 2001 points
     38     Jonathan – 1747 points
     39     Amazingly, they've all accomplished these totals in the minimum number of tasks possible in order to reach each amount. For example, if their total was 6 points they would have accomplished this in just 2 tasks (2 "Add Thing" tasks), as opposed to accomplishing it by 3 "Add Place" tasks. Your job is to compute how many total tasks each user has completed. After you've done so, find the answer to Problem 2 using the following formula:
     40 
     41     Problem 2 Answer = Doug's total tasks * Jordan's total tasks * Eric's total tasks * Jonathan's total tasks
     42 
     43     Congratulations. You are web-scale!
     44 
     45     You've successfully completed the Hyperpublic Programming Challenge. Awesome!
     46 
     47     Here's your completion token: XXXXXXXX Email it to us!
     48 
     49     Email your completion token to challenge@hyperpublic.com, along with any code you've written to help solve the challenge, and you'll be entered in the prize raffle to take place on Monday, February 28.
     50 
     51     Hyperpublic is working on big problems around local data capture, search, indexing, and classification, and we're always looking for great hackers to bounce ideas off of. If you're interested in free office space and/or hearing more about Hyperpublic, let us know in your email.