I stumbled upon the Google Foo Bar challenge today. While solving the first question which was pretty simple --> Involved creating concatenation of all prime numbers in String, let's call it as primeString
, and then just taking 5 lettered substring from that primeString
from given index i.
I was happy that it was easy and tried approach of generating prime numbers using Sieve. It showed the error shown in the image below. I also tried normal brute force method of generating prime numbers, again it showed the same error.
I am using Java language to solve it. I am using an online Java compiler as IDE and then I copy-pasted my code into the editor since the default editor does not have any code compilation feature.
I searched throughout the meaning of this error. I couldn't find any solution. Can someone please explain to me what this error is?
Google Foobar challenge is a secret hiring process of Google to recruiting top programmers and developers around the world. This is a way through which they provide direct interviews to the individual who cleared the challenge.
This can be the result of a Compilation Error, Run Time Error or Change of format from their template. Blacklisted Code - There are some libraries that are prohibited to use. If you use one of them, your code will be blacklisted.
Level 1 has one challenge with a time limit of 48 hours (2 days). Level 2 has two challenges with a time limit of 72 hours (3 days) per challenge. Level 3 has three challenges with a time limit of 96 hours (4 days) per challenge.
Foobar is Google's Secret Hiring Process. Typically, after you finish Level-3, you should see a question asking if you're interested to hear from a Recruiter at Google. That gives you an opportunity to get interviewed for a position at Google that matches your qualifications. That's the benefit — you get shortlisted!
I came across the constraint.txt file in the challenge which had the below rules for Java:
So based on the point highlighted, I had used import java.utils.*
wildcard import statement in my java code. Wildcard imports would constitute Blacklisted code, which was why I was getting the error. Thanks everyone for your help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With