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
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Game Theory
  4. Fun Game
  5. Discussions

Fun Game

Problem
Submissions
Leaderboard
Discussions
Editorial

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

  • h0mesickAlien
    5 years ago+ 1 comment

    For anyone that may be a little confused by the challenge, and failing a test case here or there... think of it this way. The best choice for the player is to choose the index that benefits him the most, but is not as simple as finding the largest un-used number left in the player's array. It might be a smarter strategy to block the other player's largest number. Example:

    Player1nums : 100 200 500 Player2nums : 900 200 50

    Player1 should pick index 0 because it blocks player2 from collecting on that 900.

    Is there a way to assess the benefit of picking a given i value? Find that way of assessing the benefit and you are on your way to solving this.

    12|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature