We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
According to the PHP documentation of array_slice third argument denotes the length of the slice.
array array_slice ( array $array , int $offset [, int $length = NULL [, bool $preserve_keys = FALSE ]] )
If I do not pass third argument then it will be NULL by default. As a result the slice will be created until the end of the array. I believe there is nothing to do with the volume of the array. Moreover, without passing the third argument like I denoted in my previous comment I am having all the test cases passed.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
According to the PHP documentation of
array_slice
third argument denotes the length of the slice.array array_slice ( array $array , int $offset [, int $length = NULL [, bool $preserve_keys = FALSE ]] )
If I do not pass third argument then it will be
NULL
by default. As a result the slice will be created until the end of the array. I believe there is nothing to do with the volume of the array. Moreover, without passing the third argument like I denoted in my previous comment I am having all the test cases passed.