Code is being modified when I post it
Posted: Tue Mar 25, 2008 12:27 pm
I solved problem 15 using Java coding and I posted my code, and I was reviewing it to compare it with other answers and my code was modified...
it seems its remove consecutive [][] which mean 2-dimensional array in Java
I removed the [ CODE ] tags but it still did the same thing :S
this is my original code
*************************************
if (i==1) path[j]=i;
else if (i==paths/2) path[j]=2*path[j][i-1];
else path[j]= path[j][i-1] + path[j-1];
finalPath=j;
}
}
for(int i=1;i<43;i++)
routes+=path[finalPath];
*************************************
this is what its changing to
*************************************
if (i==1) path[j]=i;
else if (i==paths/2) path[j]=2*path[j][i-1];
else path[j]= path[j][i-1] + path[j-1];
finalPath=j;
}
}
for(int i=1;i<43;i++)
routes+=path[finalPath];
*************************************
it seems its remove consecutive [][] which mean 2-dimensional array in Java
I removed the [ CODE ] tags but it still did the same thing :S
this is my original code
*************************************
if (i==1) path[j]=i;
else if (i==paths/2) path[j]=2*path[j][i-1];
else path[j]= path[j][i-1] + path[j-1];
finalPath=j;
}
}
for(int i=1;i<43;i++)
routes+=path[finalPath];
*************************************
this is what its changing to
*************************************
if (i==1) path[j]=i;
else if (i==paths/2) path[j]=2*path[j][i-1];
else path[j]= path[j][i-1] + path[j-1];
finalPath=j;
}
}
for(int i=1;i<43;i++)
routes+=path[finalPath];
*************************************