C++ vs Java!

Hello Guys !
In one of the competition i coded in java first , the answer there came was wrong ! I applied the same logic in c++ and i got right answer ! Can anyone tell me why this happens frequently ?
Thanks in advance : /

P.S : I would have shared you the link of both my codes but it is of ongoing competition .

Most likely, one of your solutions just has a bug and it has nothing to do with the language

1 Like