Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
When is it possible to convert original into a 2D array and when is it impossible?
It is possible if and only if m * n == original.length
If it is possible to convert original to a 2D array, keep an index i such that original[i] is the next element to add to the 2D array.