One d array insted of 2 d array

Why we cannot take 1-D array in this problem

@kalash hey, yes aap one d vector of strings bhi use kr skte hai ya fir map bhi ,it all depends on you.