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 google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/f31846f3-648a-4d64-8083-f2291d3a1d79%40googlegroups.com.

Reply via email to