Lesson 17 of 34

2D Arrays: Matrices

10 min 30 XP

2D array എന്നത് rows-ഉം columns-ഉം ഉള്ള പട്ടികയാണ്, m[row][col] എന്ന് ഉപയോഗിക്കുന്നു. m.length rows-ന്റെ എണ്ണം, m[0].length columns-ന്റെ എണ്ണം.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Transpose: m[r][c]-നെ t[c][r]-ൽ വെക്കൂ. ജനപ്രിയമായ ഒരു matrix interview ചോദ്യം.

Challenge

+30 XP

r, c (rows, columns) വായിക്കൂ, പിന്നെ matrix. ഓരോ row-യുടെയും തുക സ്വന്തം വരിയിൽ print ചെയ്യൂ. Input: 2 3 1 2 3 4 5 6 Output: 6 15

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.