变量 j 初始化为 172,这是它应该迭代的 wordList 的长度。wordList 是一个 ArrayList 感谢您的帮助。
for (i = 0; i < wordList.size(); i++)
{
row0 = wordList.get(i);
ara = breakWord(row0);
my2Dara[0] = ara;
for (j = 0; j < wordList2.size(); j++);
{
row1 = wordList2.get(j);
ara = breakWord(row1);
my2Dara[1] = ara;
for (k = 0; k < wordList.size(); k++);
{
row2 = wordList.get(k);
ara = breakWord(row2);
my2Dara[2] = ara;
for (l = 0; l < wordList.size(); l++);
{
row3 = wordList.get(l);
ara = breakWord(row3);
my2Dara[3] = ara;
for (m = 0; m < wordList.size(); m++);
{
row4 = wordList.get(m);
ara = breakWord(row4);
my2Dara[4] = ara;
if(isSolution(my2Dara, wordList) == true)
print2Dara(my2Dara);
}
}
}
}
}