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.