This turned out to be an interesting round as the answers varied quite a bit. Some people recognized you could simply convert to a real integer, do the operation, and then convert back. Perfectly valid. Others chose to use loops to perform the operations
Read More...
There were a few less takers for this one than the others, it seems the complexity of the problem may have been a little high for an Internet competition. None the less, let's plow through what a good answer is. First, the point of this one was to make
Read More...
Here’s my answer to last week’s contest : struct Node { Node **links; // pointers to other nodes // links[n] will never be NULL // 0 <= n < numLinks int numLinks; // number of links int color; // initialized to 0, // yours to use for whatever };
Read More...
So here is my answer to Monday’s contest: unsigned __int32 factorial( unsigned __int32 n ) { static const unsigned __int32 values[] = {1,1,2,6,24,120,720,5040,40320, 362880,3628800,39916800,479001600}; if ( n >= sizeof ( values ) / sizeof ( values[0]
Read More...