Permute Multidimensional Array without allocation

I’ve been stuck trying to solve this problem too! I have a use case for this kind of mechanism that I haven’t been able to crack: Complex Numbers Wrappers