0
How can we slice an array into 4 equal parys
Pls how do u slice an array into 4 equal parts with any array of any length. I have created a little liner of code that gets any Integer and stores it in an array. Please help me https://code.sololearn.com/coPKQ4SvFp9K/?ref=app
1 Answer
+ 6
Sonicspeed^__^ A few doubts first, what if the number of elements isn't fully divisible by 4? one or more of the splits will have less elements than others. Second, what if the array has sub arrays in it?