SIGABRT error ?

My Solution for Football Match : Solution

But I keep getting SIGABRT on Submisson
Can someone please help me.

Thank You.

Hii, Bionic_beaver!!

I saw your solution, remember that n can be zero so when you do team2=a[n-1] it becomes a[-1] so it is giving SIGABRT. So you have to edit it. Edited AC code- https://www.codechef.com/viewsolution/18688127

Just a suggestion, Why are you making the solution so complicated, you don’t need to sort the array there are only 2 different strings you don’t even have to make an array of strings, 3 strings would do the job. You are just complicating the solution. See my code-
https://www.codechef.com/viewsolution/18687596

1 Like

yeah now this is good…
remove that “.” from 1st link though… :slight_smile:

1 Like

yaa thanks

1 Like

Thank You very much, I completely missed the case where n = 0

No Problem!