(d) There can be two cases :
Case I : When 1 row contains 3 balls and rest two contains 1 ball each.
Now, the row which contains 3 balls can be selected out of the 3 rows in 3C1 ways and in this row number of ways of arrangement = 3C3. In other two rows, number of ways of arrangement in each = 3C1.
Thus, number of ways for case I = 3C1 × 3C3 × 3C1 × 3C1
= 3 × 1 × 3 × 3 = 27
Case II : When 1 row contains 1 ball and rest two rows contain 2 balls each.
This row, containing 1 ball can be selected in 3C1 ways and number of ways of arrangement in this row = 3C1. In other two rows, containing 2 balls each, number of ways of arrangement in each = 3C2.
Thus, number of ways for case II = 3C1 × 3C1 × 3C2 × 3C2 = 3 × 3 × 3 × 3 = 81
As, either of these two cases are possible, hence total number of ways = case I or case II = 27 + 81 = 108.