• + 1 comment

    I used a similar approach by making a linear array for each layer and then finding the new starting position and creating the new matrix from it. It still timed out out on cases 3, 4, 7, 8. :(