I am kinda new with doing programming contests for myself. I have been coaching a high school team for a 7 years now, but this is the first time I have come across this type of problem. So it threw me off.
This problem is pretty simple. One person picks the length of the word, and the other checks to see if you can find anything divisible by it. No problem. However, the number can be 100 digits long. The variable type long cannot do that. So I get out the Java class BigInteger.
So I quickly program this up:
What I would like you to focus on is I need to get the starting number. If I use a 3 digit number, then 100 or 10^3 will be the lowest value.
I then just loop until I get to 1000 (999 as my last run through) and check to see if I can get a remainder of zero when dividing. If I can, return that number.
However, what tricked me (I just decided to hey submit it and see what happens) is the test output could have quite a few correct answers.
However, all the pretests passed and I was excited to see that. Then off to the next problem.