Ad
  • Custom User Avatar

    Kumited a Java translation!

  • Custom User Avatar

    This code is FAR from unreadable.... I really don't understand the difficulty here. The only thing that might be hard to understand for someone who's even remotely new to coding in Java (or in general) is the ternary operator. Even that can be easily understand with a quick google search.

  • Custom User Avatar

    No, read the posts below before creating a new issue about the same.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Nvm, I asked some friends and I understand perfectly now. Thank you for the help though, @dinglemouse

  • Custom User Avatar

    Oh, I understand what the code is doing, it's the math itself I don't think I'm fully grasping. Like why is he multiplying the weights by 3?

  • Custom User Avatar

    Explanation:

    (the counter n is 1-based to make it easier to read)

    • Three 1's => 1000 points : n[1]/3*1000 Note: all these are int arithmetic
    • Three 6's => 600 points : n[6]/3*600
    • Three 5's => 500 points : n[5]/3*500
    • Three 4's => 400 points : n[4]/3*400
    • Three 3's => 300 points : n[3]/3*300
    • Three 2's => 200 points : n[2]/3*200
    • One 1 => 100 points : n[1]%3*100 use mod to catch the remainder 1's not worth 1000 points
    • One 5 => 50 point : n[5]%3*50 use mod to catch the remainder 5's not worth 500 points
  • Default User Avatar

    God I need to strengthen my math skills. This never even crossed my mind x_x

    edit: If anyone sees this comment and understands the code above, could you explain it please. I'm actually having some trouble understanding the math behind it.