Ad
  • Custom User Avatar

    No trap, no erroneous tests, OP solved it in 2 lines, closing...

  • Custom User Avatar

    .concat() in a "for of". convert in toString() the key value. After replace a mask (**) -. this is resolution.

  • Custom User Avatar

    Are you volunteering to translate it? 😆

  • Custom User Avatar

    Interesting kata, if only you could add Kotlin :)

  • Default User Avatar

    This doesn't explain how to make a number.

  • Custom User Avatar

    Approved after 4 years OwO

  • Custom User Avatar

    Nice one, quite challenging kata.

  • Default User Avatar

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

  • Default User Avatar

    You are ignoring the overlapse. For example the ex.1 Has 1-5 and 1-5. if you were to write every number between the both of them you would indeed get 9 numbers(length 8), but all of them would be dublicated. So the number of the unique numbers is 5(and the length is 4): 1, 2, 3, 4, 5; it is simpler to understand if you write the intervals on one line in a pice of paper. :)

  • Default User Avatar

    We can forget about 1-5 and 16-19 because they are inside 1-6 an 10-20. 1-6 and 5-11 = 1-11. And 1-11 and 10-20 = 1-20. It's length = 20-1 = 19;

  • Custom User Avatar

    It only shows up in "Past solutions" if you already hit Attempt and it was successfully passed all the tests.

    However, you only need to press test/attempt button and your code will be saved locally when you enter the trainer again. If you don't, and navigate elsewhere, your code gets lost.

  • Custom User Avatar

    It didn't - it's still there in "Past Solutions", when you go back to the task.

  • Custom User Avatar

    WHERE ARE THE SOLUTIONS?????

  • Custom User Avatar

    Thanks for the tips, I will look into the issues this evening.

  • Custom User Avatar

    Well, you chose C for this task, so any pain is warranted :P

    With C it's important to read comments/description to see how you should present the result.

    I only took a quick peek at your solution (after spending significant time myself trying to solve it, and suffering), and I noticed that you're assuming result is null-terminated at the beginning. It probably isn't, and contains garbage value, so when you try to concatenate another string, the result is not what you'd expect. There are probably other mistakes which I didn't investigate (for example, do you really need to copy the input sentence? What if it's longer than your number?)

    You can also make use of functions like printf to show intermediate values and help you debug the solution.

  • Loading more items...