Ad
  • Custom User Avatar

    maybe, but what default would make sense here? the (implicit) default case here returns undefined, which i think is appropriate

  • Custom User Avatar

    There are a few ways to get know if a number is power of two. And all of them will work quickly with small numbers. But the hidden test cases(which you run by pressing 'submit' buttom) use very big numbers. And some alghoritms will be able to deal with very big numbers for a short time. Yes, it's a kind of joke why i didn't show all values in public test cases:)

  • Custom User Avatar

    The timeout happens because of test cases use very big numbers, and not all solutions can be good.