Ad
  • Custom User Avatar

    Yes. You can print the input as I suggested so you can see with which ones your code fails.

    About [0,0,0]:

    An array is said to be hollow if it contains 3 or more 0s in the middle that are preceded and followed by the same number of non-zero elements. Furthermore, all the zeroes in the array must be in the middle of the array.

    • It contains 3 or more 0s
    • All of them are in the middle of the array
    • They are preceded and followed by the same number of non-zero elements (none in this case)

    Is it clear now?

  • Custom User Avatar

    it is

    what are you trying to achieve by getting the test cases ;)? if you are struggling to complete it, you can unlock solutions to see what other users have done

  • Custom User Avatar

    I'm considering the minimum length of the array to be 5.

    That's not true.

    Print the input to debug your code. What is a hollow array is well defined, not a kata issue, closing.

  • Custom User Avatar

    firstly, this is not an issue, this is a question, so try to post with question tag

    secondly, you could try using markdown syntax to make the code more usable for ppl trying to copy/paste your code.

    you can read this in the meantime

  • Custom User Avatar

    What? No :D It's your code. Just replace every print_r with return.

  • Custom User Avatar

    You are printing the result to console, when you should return it.