title: Algorithm to convert a multi-dimensional array to a one-dimensional array
body: <p>It's easy enough to convert a 2-dimensional array to a single-dimensional array but how can I convert a multi-dimensional array of more than 2 dimensions to a one-dimensional array? For example, let's assume I have int [5][5][5] x and int [125] y and I want to place the value at  x[3][4][2] in its right place in y? </p>
  
  <p>Hope that makes sense. </p>