Getting AC and WA with same logic but different printing way help( c lang.)

https://www.codechef.com/problems/ACBALL (problem link)
solutiion 1 https://www.codechef.com/viewsolution/29878464 link partially accepted
solution 2 https://www.codechef.com/viewsolution/29879663 ac ( just printed directly without storing)
can someone tell why the difference.

I think null character is messing up.
You are not adding null character to the end of your manually created string(str3).

2 Likes

yes it worked
Thanks a ton
though on output it doesnt look different for test cases i ran on.

1 Like