Ad
  • Custom User Avatar

    Trying it in C++, having a problem with the invalid cases...

    In the final fixed tests Invalid_Shuffle_Control3
    Entry vector is (10,20,30)
    chunk size is 1, control is also 1 (000000000000001).
    If I follow the description:
    Chunk size is 1, and all bits to one, so I should zero the first entry of the give chunk.
    Then I go to the second chunk, etc etc...
    Thus the result of my solution is => ret=1, vector {0,0,0}...

    But it is expected to have an invalid control ????
    Expected: equal to ret = 0, vector = { 10, 20, 30 }

    Cannot figure out what's wrong ??

  • Custom User Avatar

    The description should make clear that the final chunk is implicitly padded with zeros if it's length is less than the chunk_size. This can be figured out from the sample test cases, but it is difficult to see because there is also the zeroing behavior from the all-ones index. (I initially thought that the final chunk's actual size is used for it's chunk_size, since that leads to the same behavior in certain cases)

  • Custom User Avatar

    In the Python translation, the random test cases require you to handle chunk_size > 15, but the description and the C++ cases say that should be rejected by returning false. This should either be removed from the Python description (keeping past solutions valid) or the test cases should change to be the same as the C++ cases.

  • Custom User Avatar
  • Custom User Avatar

    There should be an empty line before section titles in description, otherwise the title is appended to the previous paragraph.

    You can use markdown for titles, for example:

    #### Element zeroing
    
    
  • Custom User Avatar

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

  • Custom User Avatar

    No random tests

  • Custom User Avatar

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