Ad
  • Custom User Avatar
  • Custom User Avatar

    Just in case you aren't aware, the reason you are failing that test is because each 3x3 block must contain exactly one of each integer from one to nine. For example, in your hard coded solution, look at board[0][1] and board [1][0], they are both two, board[0][2], board[1][1], and board[2][0] are each three.

  • Custom User Avatar

    No problem, solved then.

  • Default User Avatar

    Thanks for that, I moved my return to the wrong location while debugging a different problem. All solved now.

  • Custom User Avatar

    The Ruby random tests have between 2 and 9 subarrays, why are you analyzing only one? Also, note that for each subarray you can have at most one mini win. Check the instructions again.

  • Default User Avatar

    I'm passing around 90 tests each time.
    Looking at the second log alone: How can I get three matches on only two characters?
    Both of these logs show that the values for each character don't match the value needed for a match.
    Every test that I'm failing is similar to these two where I return loser but the test is expecting winner.
    I figure either I'm missing something or the tests are bad.

  • Default User Avatar

    Using Ruby for this and I'm not sure where I'm messing up. Here are two Logs from where I'm using puts to print out the various values:

     Log 1
    Characters: SWPSDG
        Value to match: 84
    
    Character: S Value: 83
    Character: W Value: 87
    Character: P Value: 80
    Character: S Value: 83
    Character: D Value: 68
    Character: G Value: 71
    
    Matches to Win: 2
    Total Matches:  0
    Loser!
    Expected: "Winner!", instead got: "Loser!"
    
     Log 2
    Characters: XS
        Value to match: 62
    
    Character: X Value: 88
    Character: S Value: 83
    
    Matches to Win: 3
    Total Matches:  0
    Loser!
    Expected: "Winner!", instead got: "Loser!"
    
  • Custom User Avatar

    Beautiful solution(s)!

  • Default User Avatar

    This is really incredible.

  • Custom User Avatar

    no problem, I'll do that later today (poke at me if ever I forget to do so)

  • Custom User Avatar

    @guysbryant - thanks for that info

    For Java

    • I've added some more scenarios to the 0-15 test case
    • I've added more random tests for shorter arrays (20balls instead of 200balls)

    @B4B - any chance you could do same for Python/Ruby?

  • Default User Avatar

    I finally passed all of the tests. The problem was with how I was thinking about tennis scoring which resulted in mishandling the array. My solution, which passed all of the static tests and none of the random tests, was:

    1. ignore a false which is proceded by a true
    2. award points to the non serving player on a double false
    3. award ponts to the serving player on a true, false
    4. ignore a double true
      This resulted in the server always being awarded a game point on any true, false, regardless of how many trues preceded the true, false and the other player could only score a point on a double false.

    Example 1: balls={[false, true, true, false, true]}
    false > ignore
    true, true > ignore
    false > ignore
    true > implied false > server gets a point

    When handled properly:
    false, true, true, false > non serving player gets a point
    true > implied false > server gets a point

    I don't know if you need to add a test for this, but a test like the following would have caught me early on:
    balls={[true, true, false]}
    balls={[true, true, true, true, false]}
    These are essentially representing a volley in which the non serving player scores a point, which is never tested for until the random tests.

  • Custom User Avatar

    Hi @B4B - please give me some example of missing test with even numbers of in. Does it have to span games etc? What's the details?

  • Custom User Avatar

    Hi again, DM!

    Ok, so after some chatting with guy, it turns out that the fixed tests are lacking some inputs with an even number of consecutive in. That's why he could pass the fixed tests. Could be a good idea to add one more with a miw of the sequences (odd/even).

    cheers

  • Custom User Avatar

    @DM: I just added a first batch of random tests (length 80 for the input). Is that ok for you?

  • Loading more items...