There were 123 contestants.

When the boxes are opened, it turns out that:

1. 43 people have guessed none of the fruits correctly

2. 39 people have guessed one fruit correctly

3. 31 people have guessed two fruits correctly.

So, there are 10 contestants left.

Total number of combinations possible initially was 4*3*2*1

But if 3 fruits are guessed correctly, there is only one possibility for the 4th fruit.

In other words, if 3 fruits are guessed correctly, 4th fruit cannot be guessed wrong.

That means all the remaining 10 people guessed all 4 fruits correctly.