
Asked in Jio Platforms
Reverse Rows of a Matrix Problem Statement
You are given a matrix and tasked with reversing the order of elements in each row. This needs to be done for every row in the matrix.
Help a participant named Ninja, who is new to programming, solve this problem by reversing all rows of the given matrix.
Example:
Input:
T = 1
N = 3, M = 3
Matrix:
1 2 3
4 5 6
7 8 9
Output:
3 2 1
6 5 4
9 8 7
Explanation:
Each row of the matrix is reversed, turning [1, 2, 3] into [3, 2, 1], [4, 5, 6] into [6, 5, 4], and [7, 8, 9] into [9, 8, 7].
Constraints:
- 1 <= T <= 50
- 1 <= N <= 400
- 1 <= M <= 400
- 0 <= MAT[i][j] <= 100
- Time Limit: 1 sec

AnswerBot
4mo
Reverse the order of elements in each row of a given matrix.
Iterate through each row of the matrix
Reverse the elements in each row
Return the modified matrix
Help your peers!
Add answer anonymously...
Top Backend Developer Interview Questions Asked at Jio Platforms
Q. How do you reverse a matrix?
Q. Aggregate query on mysql. Difference between sql and nosql databases.
Q. What is an aggregate function?
Interview Questions Asked to Backend Developer at Other Companies
Top Skill-Based Questions for Jio Platforms Backend Developer
Web Development Interview Questions and Answers
250 Questions
Algorithms Interview Questions and Answers
250 Questions
Data Structures Interview Questions and Answers
250 Questions
Java Interview Questions and Answers
250 Questions
JavaScript Interview Questions and Answers
250 Questions
SQL Interview Questions and Answers
250 Questions
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

