I need to iterate through each element in a matrix like structure. For example,
SeatingType Model Back Mech
1 6 120 58
7 121 59
8
In java values will be coming as parameters as string in comma seperated values Eg SeatingTpe (1), Model (6,7,8) etc.
I need to get the result as
1,6,120,58
1,6,120,59
1,6,121,58
1,6,121,59
1,7,120,58
1,7,120,59
1,7,121,58
1,7,121,59
1,8,120,58
1,8,120,59
1,8,121,58
1,8,121,59
Please note that Model, Back and Mech could be null.So in case Model values is null, then output should be 1,6,58 and 1,6,59 so on. Any help plz
As a headstart, I tried by looping through from last element (in this case ‘Mech’)> But that is very tedious. Any other approach ? I have provided only 4 atributes over here. But the reqmnt is for 11 attributes. I was hoping if I could get solution for 4 atributes, that could be applied for rest 7
Iterate through 4 loops: