TORONTO KIDS COMPUTER CLUB | Friday 17:00 Python Practice 21.03.26.
post-template-default,single,single-post,postid-19217,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Friday 17:00 Python Practice 21.03.26.

29 Mar Friday 17:00 Python Practice 21.03.26.

Question for Sorting:

Question 1:

You are given an array A of non-negative integers of size m. Your task is to sort the array in non-decreasing order and print out the original indices of the new sorted array.


A= 4,5,3,7,1

After sorting the new array becomes A= 1,3,4,5,7

The required output should be “4 2 0 1 3”   

Input Specification :
The first line of input consists of the size of the array
The next line consists of the array of size m

Output  Specification :
Output consists of a single line of integers
NOTE: The indexing of the array starts with 0.

Sample Input
4 5 3 7 1

Sample Output
4 2 0 1 3

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 Specification:
First line will take the dimension of matrix i.e. N x N (only one input N).
Second input the elements of matrix.

Output  Specification :
Sorted Matrix in clockwise manner.


Sample Input
2 5 12
22 45 55
1 6 8

Sample Output
1 2 5
45 55 6
22 12 8

No Comments

Sorry, the comment form is closed at this time.