나는 이렇게 학습한다/Algorithm & SQL

1123. L1: Set Alarm

daco2020 2022. 11. 24. 00:50
반응형

Write a function named setAlarm which receives two parameters. The first parameter, employed, is true whenever you are employed and the second parameter, vacation is true whenever you are on vacation.

The function should return true if you are employed and not on vacation (because these are the circumstances under which you need to set an alarm). It should return false otherwise. Examples:

setAlarm(true, true) -> false
setAlarm(false, true) -> false
setAlarm(false, false) -> false
setAlarm(true, false) -> true



Solution:

bool setAlarm(bool employed, bool vacation) => true ? (employed == true && vacation == false) : false;


반응형