Ad
  • Default User Avatar

    Description states:

    [ - Jump past matching ] if value at current cell is 0

    Hence:

    • start with leftmost cell. that is 0
    • move past matching ]. that is past the end.
    • terminate, since going out-of-bounds is termination condition
    • return unchanged tape
  • Default User Avatar

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

  • Default User Avatar

    That makes sense. However, such tests would invalidate some (incorrect) user solutions. It doesn't matter if arrays are of size 4 or 5 but it does matter if one array is 5 and the other 4.

  • Custom User Avatar

    Description mentions that Each array includes only integer numbers. So, empty arrays should not be considered. Also, arrays of different length do not affect how such problems are solved, so I would say it is more on perspectives. Plus, unifiying each language in terms of test cases can be difficult because translations can be done by any user once they reach a specific honor threshold, though efforts on improvising these have been done more actively lately

  • Default User Avatar
  • Default User Avatar

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

  • Default User Avatar

    I like the comments and variable names

  • Default User Avatar

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

  • Default User Avatar

    Shouldn't all of them do that? I was wondering if there is a reason why they don't.
    I think it is important thing to think about (that arrays may have different length) and therefore to test for. Arrays could be empty too but I guess the description vaguely hints that there will be integers (and only) inside.
    Do you think it would make sense for me to extend the test cases? Assuming I am allowed to do so.

  • Custom User Avatar

    Yet another 8 kyu (the smiplest) task which is not that simple actually.
    But it is good practice, I liekd it.

  • Custom User Avatar

    Some languages have such tests. This constraint isn't mentioned in description, but the author probably chose equal arrays anyway. I don't think it would impact the rating at all.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    With code formatted like that hardly anyone will bother to try to read it. Use markdown as suggested.

    I find it hard to follow your logic. Maybe it is too late/early for me.

    One thing I did notice is that this two codes differ.
    The local one is actually invalid because the function does not return anything (should return bool). Not to mention the stray include at the beginning and lack of necessary ones.
    You can't interchange return and cout. Those do not have the same behaviour. return stops execution of a function, cout does not.

    The problem with passing the kata is somewhere else though. Try to test (({{[[]]}})) as suggested. Follow the code execution or try to follow the algorithm yourself, possibly on a paper. There is a problem with your logic or the expression of said logic.

  • Default User Avatar

    I don't believe that interchanging int and bool is a good idea.

  • Loading more items...