A programming challenge

I have a challenge for you guys...

You have to do a function, that takes an array of structs. Each one of these structs will contain integer X, Y coordinates from 0 to 10.

You need to determine the order in which to move the coordinates for each struct and which one travelled the shortest distance.

The structs can move one-by-one (easy) or all at the same time (i don't know if this is even possible). The function needs to return the order of movement for each struct and distance travelled of each struct.

You can do it in any language you wish...

GO!

Attached: gold-medal-w-ribbon.jpg (1936x2581, 1.6M)

Do your own homework, no one is falling for your bait

>>>/stackoverflow.com/

I said any language, it is not a homework.
I just want to see it being done in multiple languages

I just got into coding, currently learning C, can anyone post that coding challenge pic?

>You need to determine the order in which to move the coordinates for each struct and which one travelled the shortest distance.
What?
>
The structs can move one-by-one (easy) or all at the same time (i don't know if this is even possible). The function needs to return the order of movement for each struct and distance travelled of each struct.
What?
What movement?

Imagine it like a class.
Each instance has two variables: int X and int Y

You "move" them by changing the two values

>got a C task
>>let's do it guise, any language!
>someone does it in C finally
>>got em

It is not my fucking homework! Do you really think that someone would assign such a trivial task?

Do it yourself in those languages then, fucking faggot.

if it is such a trivial task why don't you do it in other languages?

>trivial
>OP admits he himself is retarded, literally and unironically
Go die in a fire you prepubescent bitch. You're not old enough to be posting on this website

Because i'm not good at imagining the solution and i didn't find it on rosetta code

>i'm not good at imagining the solution
why are you even trying to code then?
you don't think you should work on that before moving on?

You need to clearly define the task/problem, which you haven't done at all

move them to what you fucking mongoloid? do you pass it a target position to move towards?

is this?

#include
#include

struct pos {
int x, y, sum;
};
void main(void){
int n = 5, l;
/*scanf("%d",&n);*/
struct pos p[n];
for(int x=0; x

> You need to determine the order in which to move the coordinates for each struct and which one travelled the shortest distance.
int[] order;
int[] distanceTravelled;
int shortest;
for (int i = 0; i < gayStructsArray.length; i++) {
order[i] = i + 1;
distanceTravelled[i] = 0;
}
shortest = 0;

There you go. I simply assumed they would all stay in place (since that's consistent with your problem specification).

This one is perfect.
I wanted to see it being done in the cleanest and most elegant way possible, this is what i wanted

I'm really sorry for not describing the challenge more. but 66373178 managed it, so it was possible

Given that you have given no rules as to how these structs must be positioned at the end the following should be valid.

Return([0 for I in range(Len(inpiut))])

i is clever, i guess you pass

oops, i meant "this is clever". sorry

This was my thought, i mean, the question is obviously incomplete.