Actually, you're right... It is wrong. I guess it's more unlucky that it
passed the first test case then..... Thanks for pointing it out.
On Thursday, 28 May 2020 20:59:11 UTC+2, porker2008 wrote:
>
> You have an extra *polAdded = false* that caused the wrong answer.
> You are lucky to pass the first test case.
>
> *for (int i = 0; i < pol.Count; i++) {*
> * polAdded = false; // Remove this line*
> * var tmpWall = new string[int.Parse(rc[0])];*
> * finalwall.CopyTo(tmpWall, 0);*
> * for (int j = 0; j < wall.Length; j++) {*
> * for (int k = 0; k < wall[j].Length; k++) {*
> * if (wall[j][k] == pol[i]) {*
> * var ca = tmpWall[j].ToCharArray();*
> * ca[k] = pol[i];*
> * tmpWall[j] = new string(ca);*
> * }*
> * }*
> * }*
> * if (isStable(tmpWall)) {*
> * tmpWall.CopyTo(finalwall, 0);*
> * order += pol[i];*
> * pol.RemoveAt(i);*
> * i--;*
> * polAdded = true;*
> * }*
> *}*
>
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/9f92d13b-73ee-42ee-8a57-6c3f2e59f810%40googlegroups.com.