All Tracks Algorithms Sorting Bubble Sort Problem

Twisted Matrix
Tag(s):

Medium

Problem
Editorial
Analytics

A matrix of same rows and same columns is given .Sakshi wants to Sort the matrix in such manner  that she will start from the first element and traverse the matrix in clockwise manner at the end she should be at  the middle position with a largest element  .Find the solution of Sakshi's problem.

 

 **Input**

First line will take the dimension of matrix i.e. N x N (only one input N).

Second input the elements of matrix.

 

**Output**

Sorted Matrix in clockwise manner.

 

 

**Constraints **

0<N<10

 

SAMPLE INPUT
3

2  5  12
22 45 55
1  6  8  
SAMPLE OUTPUT
1 2 5
45 55 6
22 12 8 
Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Technocrats TIT Group of Institutions

Challenge Name

CODE BATTLE

Notifications
View All Notifications

?