Ad
Code
Diff
  • function dividedByThree(int $number): bool {
      $rounded = round($number * 0.33, 1);
      return $rounded != 0 && filter_var($rounded, FILTER_VALIDATE_INT);
    }
    
    • function dividedByThree(int $number): bool
    • {
    • $i = 3;
    • do {
    • if (abs($number) === $i) {
    • return true;
    • }
    • $i += 3;
    • } while (abs($number) >= $i);
    • return false;
    • function dividedByThree(int $number): bool {
    • $rounded = round($number * 0.33, 1);
    • return $rounded != 0 && filter_var($rounded, FILTER_VALIDATE_INT);
    • }