DEV Community

loading...

Discussion on: Daily Challenge #302 - setAlarm

Collapse
peter279k profile image
peter279k

Here is the simple solution with PHP:

function setAlarm(bool $employed, bool $vacation): bool {
  if ($employed === false && $vacation === true) {
    return false;
  }
  return boolval($employed ^ $vacation);
}
Enter fullscreen mode Exit fullscreen mode