Ad
  • Default User Avatar

    Would you mind to elaborate? It's almost the same solution in C.

  • Custom User Avatar

    I find it very funny that I'm always overthinking things having a C background, does anyone have any tips?

  • Custom User Avatar

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

  • Custom User Avatar

    Best. Kata. Ever.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Thanks! I was just confused that it may have different solutions but in the sample tests I see only one. Actually I haven't run the code yet. It is my mistake.

  • Custom User Avatar

    oh wait, you're talking about the first sample test. Lemme take a look.

    EDIT: seems to be working properly, though. So I'll need the exact error message.

    EDIT²: mmmh... Note that the expected output is just one possible solution. You don't have to generate that one specifically: the verification function check the behaviour of your output.

  • Custom User Avatar
    • that's not the first (fixed) test ( -> {53,38,35,56}), so I guess this is the first random test?
    • that's impossible to answer to you as long as you don't provide the actual input and the exact assertion/error message printed to the console.
  • Custom User Avatar

    (Java) My result for the first test is:

    {1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 68, 67, 66, 65, 75, 85, 95, 94, 84, 74, 73, 72, 71, 70}
    
    - 8 1 1 1 1 1 1 1 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - 1 1 1 1 8 
    8 1 1 1 1 1 - - - - 
    - - - - 1 1 - - - - 
    - - - - 1 8 - - - -
    

    but it should be

    {1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 78, 77, 76, 75, 85, 95, 94, 93, 92, 91, 81, 71, 70}
    
    - 8 1 1 1 1 1 1 1 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 1 
    - - - - - - - - - 8 
    8 1 - - - 1 1 1 1 1 
    - 1 - - - 1 - - - - 
    - 1 1 1 1 8 - - - -
    

    Both results meet the requirements, but my result isn't correct. Did I miss something?