Passing 2D array to 1D array.

I'm working on a problem that asks to write a 2D array, and remove 0's from it and output it as a 1 dimensional array. I have no issues populating the 2D array, but its converting it to a 1D array that is confusing me. Can someone try to guide me in the right direction? Thanks. (P.S- I'm not asking for anyone to do the coding, just to guide me the right way)
here is some pseudo code that mgiht help:
1
2
3
4
5
6
7
8
9
10
11
12
var someList{{0,1,2,3,4,5},{0,0,0,0,1}} : List;
var afterList{} : List;

for(i = 0 : Int; i < someList.size(); i++) {
    for(sub = 0 : Int; sub < someList[i].size(); sub++) {
        if(someList[i][sub] == Int(0)) {
            next;
        }

        afterList.pushbackelement(someList[i][sub]);
    }
}
Topic archived. No new replies allowed.