Assuming it's a 2d array of text and that an "empty" slot will have an "X" in it.
Array: W=4, H=3, D=1
Array2: W=0, H=1, D=1
For "" from 0 to array.height - 1
Array.at(3, loopindex)) = "X" --> Array2:Push back loopindex on X axis
Edit: fixed a basic error. see capx. sorry if I caused you more confusion. After re-reading the OP It seems you want to check for "X", not empty cell.