79416250

Date: 2025-02-05 21:38:59
Score: 1
Natty:
Report link

I tried to solve it on the same website (Test dome), and the answer was interesting. Try to solve it with recursion and no problems; therefore your code can run on negative test cases too!

#include <stdlib.h>
#include <stdio.h>

int inspect_bits(unsigned int number)
{
    if(number == 0) return 0;
    if((number & 3) == 3) return 1;
    return inspect_bits((number>>1));
}

#ifndef RunTests
int main ()
{
    printf("%d", inspect_bits(13));
}
#endif
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Hussein Barakat