Ad
Code
Diff
  • function dividedByThree(int $number): bool
    {
        //return $number !== 0 && !(bool) base_convert($number, 10, 3)[-1];
      return ($number % 3 == 0 && $number != 0) ? true : false;
    }
    
    • function dividedByThree(int $number): bool
    • {
    • //return $number !== 0 && !(bool) base_convert($number, 10, 3)[-1];
    • return 0;
    • return ($number % 3 == 0 && $number != 0) ? true : false;
    • }