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.