Ad
  • Custom User Avatar

    I did a sum() on a generator which essentially does the same thing - which reduces LOC but is less clean. I guess OP just wanted to keep the code clean and given the factorial nature of the input, recursion stack won't run out.

  • Custom User Avatar

    Yep, we should't have to rely on test cases to get some rules that weren't clearly stated in description.

  • Default User Avatar

    recursion is not working at all in this case, the only way is to use mathematical algorithm for this problem

  • Default User Avatar

    Yeah, the writer of this problem seems to put a space between their words and punctuation marks.
    Also, the algorithm that we are being made to implement here is not the algorithm for encoding into pig latin that I was taught (ie: multiple letters need to be shifted to the back until you reach the first vowel)

  • Custom User Avatar

    Hi,

    Not an issue a question. Since, if you look at the top, you'll see thousands of JS completions, so the problem is on your side, not in the test suite itself. Some definitions (terminologies specific to CW) and useful information:

    • Issue: problem in the kata itself (description, wrong tests, wrong internal solution...)
    • Suggestions: well, I guess that part is clear
    • Question anything else that is related to you having a problem solving a kata -> that's you, currently.

    Just in case, for later use... When you post issues:

    • provide ALL the useful information:
      • language
      • input
      • outputs (actual expected) when relevant
      • error message when relevant
    • check, DOUBLE check that this IS an issue, meaning that the problem is in the kata itself and not in your code. If it's in your code, post rather a question
    • if you pass this step, you still have to prove/explain what the issue is (and if you can provide fixes, it's even better)

    When you post a question: well, most of the above apply too x)

    When you post code, use proper github markdown, so that it's readable.

    For instance, either your code is too slow and you have to change your algorithm, or you put in there a loop that never terminates in some cases.
    Trick: print stuff to the console from inside the loop(s) so you'll hit the buffer limit size before the time out limit and you'll be able to get feedback about what's going on in your code.

    cheers

  • Custom User Avatar

    In JS: Execution timed-out for this kata, everything else is working fine but I can't test my code and hence cannot submit.

  • Default User Avatar

    you will change opinion when you will see that in fact, recursion is the only one way to go with for fast.

  • Custom User Avatar

    Why not using a loop rather than recursion?

  • Custom User Avatar

    IMHO, any solution using recursion should be rejected.

  • Custom User Avatar

    old kata == easy kata

  • Custom User Avatar

    I found this kata overly simple for a 6 kyu!

    It just requires being able to use if/elif/else (or switch/case),
    and being able to format a string.

    Aren't these basics?

  • Custom User Avatar

    Statement should be a bit more clear about what it means by "0".
    I.e. 0 and 0.0 should be moved to the end, but not '0' or False

    This is ambiguous, IMHO.

    Hopefully, the example make it a bit more clear, except for '0'!

  • Custom User Avatar

    Highest solution completely fails with this simple test:

    Test.assert_equals(pig_it('Test!'),'estTay!')

    The validation tests for this should really be improved,
    and the example in the statement should be corrected.
    (Typography rules in English -> no space before exclamation mark!)

  • Custom User Avatar

    In English, there shouldn't be a space before '!'.

    Your proposed test should write:

    Test.assert_equals(pig_it('Hello, world!'),'elloHay, orldway!')

  • Custom User Avatar

    For example, you may use re.split(...)

  • Loading more items...