Hi everyone,
I've a problem to programming a sorting function.
can you help me out?

input
3
1 2 3
4 5 6
7 8 9

4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

output
1 2 4
3 5 7
6 8 9

1 2 4 7
3 5 8 11
6 9 12 14
10 13 15 16

help me out, please!

Recommended Answers

All 3 Replies

It looks like you are taking a sorted list and jumbling it? What is the significance of the different rows?

You're going to have to show us you've tried before you will get any help. Post your code.

I don't think they're just jumbling it. I think that, for whatever reason, they're trying to re-order the data diagonally from top-right to bottom-left rather than horizontally.

You are correct though. We need to see some effort first.

Haha yea now I see it :) (kuromiyaruka, this is the kind of explanation that should definitely be in your original post!)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.