Google Foobar Challenge Java Issue

I just got invited for Google Foobar Challenge like many other developers.
Befour you read further my issue I assume you have given Google foobar challenge.
I was solving the level 1 . And the problem was easy.
But when I coded the solution in java.I was continuously getting TestCase failed. Even though I checked the output for the visible test case which was given as sample input and output in the question.It was right. But when I Verify it on the foobar site it said testcase failed.
I was very confused. I was confident that nothing is wrong with my solution. So i coded it in python with same logic and it got accepted.
Anyone who encountered same issue in the challenge… Plz help me clear this doubt what went wrong.


I think the problem you are talking about is PREPARING THE BUNNIES ESCAPE, which needs graph algorithm to solve. The problem with JAVA is that if you look at the input , more importantly the way they are giving input. In the input a 2-D array was passed as parameter directly instead of saving it into a variable and than passing .JAVA being as static language does not allow this and as python is a dynamic language so this is possible in it. I don’t how they could have messed this up …it took so much of time to find this error.

1 Like

Thanks a lot, mate.
I am solving my challenge #3, and it was failing.
In my code, I was trying to save space by re-using the input array, replacing them with output values.
What you mentioned is true. They’re passing input without storing it in a variable, when I tried changing the values, it didn’t have an address.
I declared a variable in my Java code and it was fixed.
Surprising to think they messed up here. But hey, they might be testing us, if this was intentional.