"Foreign exchange students came on Thursday and Friday."
You need to think of the が particle as being attached to what is before it, not what is after it. In this case it is attached to the foreign exchange students (りゅう学生) making them the subject.
The に particle (meaning at or on) is, hence, attached to the 'Thursday and Friday,' making this the time that something happened.
来ます is just the polite form of the verb meaning 'to come.' So, whatever the suject of the sentence is, it will be coming.
I think the only difference is that you give a little bit more attention to the 「木曜日と金曜日」information, while the original sentence is more focused on the fact that foreign students came, while "on thursday and friday" are just complementary information.
Your sentence is reversed, you say the same but with slightly more focus on the days those students came.
But I am no japanese speaker. I just read somewhere, that slightly more focus is on the information closest to the verb, words further away from the verb are more complementary.
Technically it's fine actually because you're still pairing the right particles with the right objects. As I understand it from studying Japanese sentence structure, the order of place versus time versus whatever is more a guideline. It might sound a little weird to a native speaker, but you'd still be understood
I think both would work. If you translate the sentence with が literally, it would be "Foreign exchange students came on Thursday and Friday.".
If you used は on the other hand, I think it would literally translate to: As for foreign exchange students/ concerning foreign exchange students, they came on Thursday and Friday.
When you're referring to something on a specific day, に is appropriate. With a statement about days in general--like on Wednesdays (all of them, generally)--は is usually used or omitted because a more direct translation would be "As for (the topic of) Wednesdays..." as opposed to "On (this particular) Wednesday..."
に can indicate not just place but also time (as in @el379898 examples) and is used to indicate a more specific time when compared to は or で
to answer the question how particles are used in this sentence: 「水曜日(と)金曜日」に「留学生(が)来ました」 「wed(&)fri」on 「exchange students (<-- indicates subject of the action) came」
に indicates place. It's used to make an adverbial phrase out of a noun, like in English ‘ON Monday’ or ‘AT four o'clock’.
honestly I've seen similar sentences just with は or nothing at all and I find that a lot more confusing — as in, it isn't clear to me when you're supposed to use に or で or when you can get away without anything.
the use of は probably deserves a whole book :-/
Maybe they've updated it? I'm having no problem with 木曜日と金曜日に留学生が来ました. Apparently, though, some people have been getting marked wrong because they used きました instead of 来ました, which is a correct judgement on Duolingo's part.
The underlining of what you got "wrong" isn't always accurate, so I wouldn't put too much store in it. The best thing to do if you're unsure is to open the discussion page and compare what you wrote with the translation they give at the top, because the correction you're given on the question page can be different.
There are many variations of accepted answers for each question, so I think when you get a correction it's not necessarily the "most correct" answer but just the one out of many possibilities that was closest to the one you gave. It should almost always take the formal version, I don't know how widely implemented the informal variations are.