//sample solution
function increaseNumberRoundness(n) {
var nArrayed = n.toString().split("").reverse();
//document.writeln("nArrayed: ", nArrayed, "<br/>");
//document.writeln("nArrayed length: ", nArrayed.length, "<br/>");
var nonZeroPassed=false;
var returnValue = false;
for(i=0;i<nArrayed.length;i++){
var temp = nArrayed[i];
//document.writeln("temp: ", temp, "<br/>");
if(parseInt(temp)!=0){
nonZeroPassed=true;
}
if(parseInt(temp)==0 && nonZeroPassed){
returnValue = true;
}
}
return returnValue;
}
No comments:
Post a Comment