Lesson 17 of 34

2D Arrays: Matrix

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 கேள்விகளில் இது அடிக்கடி கேட்கப்படும்.

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.