Why we use 2D character array why not 1D array

can you elaborate me the working of this 2d array?

Hello @sonu28sharma99,

There is no compulsion on using 2D array to store mapping.
You can also use 1D array for this purpose.

But, the choice of array completely depends on the way you are storing it.

  1. In the question, sir is making a 2D array of characters i.e. they are storing each character of the mapping at a separate cell.

  2. You can rather use a 1D array of strings to store this.

Hope, this would help.
Give a like if you are satisfied.