some of the numbers in the automorphic array have squares that do not fit in an unsigned 64-bit integer, which means naive solutions (including the reference solution) are wrong for these numbers
there should be a note in the initial code specifying that the tests expect a string literal, i.e. the memory won't be freed. it's already hinted by the const modifier but it's best to be explicit
extracting the length of the array to a named constant AM_LEN is a good effort, but it would be even better to let the compiler calculate it for you, so that potential additions/deletions of array elements in future maintenance do not require a recounting:
Your solution is easily viewable by clicking "View Solution" under your comment, so there is no need to share it in discourse. But if you really want to, be sure to click the spoiler checkbox before posting ^^
I guess because the return type of countBits is set to size_t
it is called prefix increment
C++ approved by someone else.
Updated Java to JUnit 5 and approved.
fork
merge conflict
done, thanks
automorphic
array have squares that do not fit in an unsigned 64-bit integer, which means naive solutions (including the reference solution) are wrong for these numbersconst
modifier but it's best to be explicitAM_LEN
is a good effort, but it would be even better to let the compiler calculate it for you, so that potential additions/deletions of array elements in future maintenance do not require a recounting:Great solution, I think is one of the efficent. Great:)
bro said my brain stupid in 103 ways
This comment is hidden because it contains spoiler information about the solution
genius
sorry im a newbie ^^
Your solution is easily viewable by clicking "View Solution" under your comment, so there is no need to share it in discourse. But if you really want to, be sure to click the spoiler checkbox before posting ^^
This comment is hidden because it contains spoiler information about the solution
Loading more items...