a digest euler puzzler (specifically php)
there another new digest euler doubt nonetheless i cruise bit some-more specific (i'm wholly unequivocally prying php formed solutions) i'm seeking anyway.
tasks with: "what smallest array regularly divisible numbers 1 20?"
now, i have solved twice. once unequivocally inefficiently once many some-more good nonetheless i am still distant divided an generally worldly answer (and i am generally plain math hence beast force solution). i integrate areas where i provoke nonetheless i am wondering any denote some-more fit fortitude problem.
*spoiler: here reduction optimal (7 seconds run) nonetheless still endurable fortitude (not certain double $... only feign wholly 1...
duty euler5(){
$x = 20;
($y = 1; $y < 20; $y++) {
(!($x%$y)) {
} else {
$x+=20;
$y = 1;
}
}echo $x;
};
Comments
Post a Comment