Masala #6BPDEFISII

Xotira 32 MB Vaqt 1000 ms
14

Exclusive "or" (xor) Logical Operator

Overview

In some scripting languages like PHP, there exists a logical operator (e.g. &&, ||, and, or, etc.) called the "Exclusive Or" (hence the name of this Kata). The exclusive or evaluates two booleans. It then returns true if exactly one of the two expressions are true, false otherwise.


Kiruvchi ma'lumotlar:

2 bool element


Chiquvchi ma'lumotlar:

Result


Misollar
# input.txt output.txt
1
true true
false
Izoh:

Since we cannot define keywords in Javascript (well, at least I don't know how to do it), your task is to define a function xor(a, b) where a and b are the two expressions to be evaluated. Your xor function should have the behaviour described above, returning true if exactly one of the two expressions evaluate to true, false otherwise.