dimanche 12 juillet 2020

How to flatten a 3D array where the 3d dimension is not fixed size into 1D array?

Given a 2D array where each (x,y) cell contains a vector of strings (for simplicity) of different size.

What's the most efficient way to flatten this data structure into 1D array, i.e. creating a function mapping injectively each string to {1,...,n} where n is the total number of strings in the data structure.

Aucun commentaire:

Enregistrer un commentaire