Ad
  • Default User Avatar

    I think it is not possible with f-Strings. The trick is that we must choose the option that best suits each problem.

  • Custom User Avatar

    elegant and simple to understand - nice one!

    I didn't know you could chain sub string slice with a reversal afterwards via seperate square brackets, I was getting caught up having it all in the same brackets, which was causing all kinds of fun :)

  • Custom User Avatar

    Thanks, good man! I had no idea that the solution would be so simple! Already completely desperate, I opened the answers, and found an answer with an explanation. Now I understand. Thanks again. The difference in difficulty between 8 kyu and 7 kyu is enormous.

  • Default User Avatar

    You're very welcome! I'm glad to hear my compulsive documentation habit is helpful.

  • Custom User Avatar

    thankyou for the explanation on the maths side, I was totally lost and managed to get there with passing 1000+ but running into issues and then stumbled onto the right answer out of frustration rather than intuition.

  • Custom User Avatar

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

  • Custom User Avatar

    This was one of my cheeky approaches when I started coding x)
    not my mistake though.

  • Custom User Avatar

    yep I guess I'm doing some basic mistake that I haven't figured out yet, but got some hints from you.. let me think about it a bit longer, problem must be on my side as no one else reporting this issue.. Thank you both, I'll confirm once solved :D.

  • Custom User Avatar

    You're probably not returning the recursive call to your function.

  • Custom User Avatar
  • Custom User Avatar

    Thank you for reply.
    Nah, I have this inside my code..

        console.log(result);
        return result;
    

    So it's returning as well..

  • Custom User Avatar

    You're supposed to return the stuff which you consider as your answer, you're logging them right now.

  • Custom User Avatar

    What am I doing wrong? When I console.log the result is correct, but the test response is undefined :-/. Thank you..

    Time: 941ms Passed: 0 Failed: 4 Exit Code: 1
    Test Results:
    Basic tests
    Log
    [ 6, 7 ]
    Expected: [6, 7], instead got: undefined
    Log
    [ 0, 1 ]
    Expected: [0, 1], instead got: undefined
    Log
    [ 0, 1 ]
    Expected: [0, 1], instead got: undefined
    Log
    [ 2, 2 ]
    Expected: [2, 2], instead got: undefined
    Completed in 5ms
    STDERR
    Unhandled rejection TestError: Expected: [6, 7], instead got: undefined

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Loading more items...