deerTrouble

Easy · Basic Logic · 3 test cases

You're at the zoo. If both deer are smiling or neither is smiling, you're safe. But if one is smiling and the other isn't, trouble is brewing!

Examples

deerTrouble(true, true) → true
deerTrouble(false, false) → true
deerTrouble(true, false) → false

Starter code

function deerTrouble(aSmile, bSmile) {

}

Complexity of the optimal solution

Time O(1), space O(1). This function performs a single comparison. The operation takes constant time, regardless of the input values. It uses a fixed amount of memory.

Solve deerTrouble in the browser