How to solve this

The function modifies the array itself whereas the method returns the array with a modified shape.

reshape, resize

resize, reshape

reshape2, resize

any of the above mentioned