This has worked for several of my classmates. It runs with no error, but ends at if (arr [r][c] == "[L]").
What else can I use to keep the brackets, but replace L with an incremented number?
int num=1;
for (int r = 0; r <= ROWS; r++)
{
for (int c = 0; c <= COLS; c++)
{
if (arr [r][c] == "[L]")
{
string str = to_string(num++);
string s = "[" + str + "]";
arr[r][c] = s;
}
}
}