Given shape D: [d0, d1, d2, ... dm-1] and a 1-d index, output the corresponding coordinates.
inputs:
shape: (2, 3)
1-d index: 3output:
[1, 0]
This problem asks you to convert a flattened one-dimensional index back into its corresponding multi-dimensional coordinates based on the given shape. The key idea is to understand how multi-dimensional arrays are stored in row-major order. By repeatedly dividing and taking remainders using the dimension sizes from the last dimension backward, you can reconstruct each coordinate position. It essentially mirrors how array indexing works internally.