Submitting multiple solutions for a problem

I submitted solution of a friend of mine which he has also submitted through his account. It was simply a mix up of files i have my own solution which is different from his. Should i upload it now? If i upload my solution(after i have already submitted his), will it not trigger plagiarism for him? Which solution is considered as final answer? All that submitted and ac or just the last ones?

why do you have his solution?

We share the same system. We live in the same room. Since both codes are in completely different languages and have very different logic, it is evident that it’s not copy pasted or plagiarized code. It was a mistake, i simply uploaded his code and as soon as i realized, i closed the tab. It was too late by then. But still, moss wouldn’t know it. So i am asking if it’s just the last solution that matters or one can be punished also for what i did [submitting plagiarized code first and then submitting the original code].

punished , as u and your friend has same AC code