Takes the index of a 3D vector element and returns the respective index of the flattened vector.
To run the cpp executable, run the following command:
g++ main.cpp -o main.exe
./main.exe
To run the Javascript file, run the following command:
node main.js