My orders
How it works
Examples
Reviews
Blog
Homework Answers
Submit
Sign in
How it works
Examples
Reviews
Homework answers
Blog
Contact us
Submit
Fill in the order form to get the price
Subject
Select Subject
Programming & Computer Science
Math
Engineering
Economics
Physics
Other
Category
C++
Software Engineering
Java | JSP | JSF
Databases | SQL | Oracle | MS Access
C
Python
Excel
C#
Visual Basic
Computer Networks
Functional Programming
Android
Assembler
UNIX/Linux Programming
ASP | ASP.NET
MatLAB
Wolfram Mathematica
MathCAD
Maple
Perl
Action Script | Flash | Flex | ColdFusion
Ruby | Ruby on Rails
Prolog
Objective-C | Swift
Algorithms
Web Development
HTML/JavaScript Web Application
NodeJS Web Application
Other
Deadline
Timezone:
Title
*
Task
*
{"ops":[{"insert":"Rotate Matrix Rings"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don\u2019t rotate that ring."},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"Input"},{"attributes":{"code-block":true},"insert":"\n\n"},{"insert":"The first line of input will be two space-separated integers, denoting the M and N."},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"The next M lines will contain N space-separated integers."},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"The next line will contain an integer, denoting K."},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"Output"},{"attributes":{"code-block":true},"insert":"\n\n"},{"insert":"The output should be M*N matrix by rotating the matrix by K elements."},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"Explanation"},{"attributes":{"code-block":true},"insert":"\n\n"},{"insert":"In the above matrix, the elements (1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5) is a ring, similarly, the elements (6, 7, 11, 10) will make a ring."},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"Therefore, by rotating each ring in clockwise direction by 3 elements will give (13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14) and (10, 6, 7, 11). So the output should be "},{"attributes":{"code-block":true},"insert":"\n\n"},{"insert":"Sample Input 1"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"4 4"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"1 2 3 4"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"5 6 7 8"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"9 10 11 12"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"13 14 15 16"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"3"},{"attributes":{"code-block":true},"insert":"\n\n"},{"insert":"Sample Output 1"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"13 9 5 1"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"14 7 11 2"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"15 6 10 3"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"16 12 8 4"},{"attributes":{"code-block":true},"insert":"\n\n"},{"insert":"Sample Input 2"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"3 4"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"1 2 3 4"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"10 11 12 5"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"9 8 7 6"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"2"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"Sample Output 2"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"9 10 1 2"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"8 11 12 3"},{"attributes":{"code-block":true},"insert":"\n"},{"insert":"7 6 5 4"},{"attributes":{"code-block":true},"insert":"\n"}]}
I need basic explanations
Special Requirements
Upload files (if required)
Drop files here to upload
Add files...
Account info
Already have an account?
Create an account
Name
*
E-mail
*
Password
*
The password must be at least 6 characters.
I agree with
terms & conditions
Create account & Place an order
Please fix the following input errors:
dummy