2-D Array

Rohit kumarRohit kumar
1 min read

In the 2D Array,
There are two sub arrays for the 1st iteration we can use the 1 for loop and for the second iteration we can use second iteration but in order to iterate that,

Frist,
We have to iterate to the first row then column.

but,
Remember when we iterate for the first time like i<nums.length;
Which means it will iterate till the end of the nums.length and for the jth column (means for the column part we have to iterate it till the j<nums[i].length.

Like in the row it will iterate each row.
Based on the length of the ith row it will iterate till the i.length.

So,

In Simpler and in easy way.
It means
A 2-D array is a collection of elements organized in rows and columns, forming a grid-like structure for efficient data storage and retrieval.

0
Subscribe to my newsletter

Read articles from Rohit kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rohit kumar
Rohit kumar