我正在通过 CodingBat 上的练习。在此页面上,解决方案中有此提及:
// The above can be shortened to:
// return ((aSmile && bSmile) || (!aSmile && !bSmile));
// Or this very short version (think about how this is the same as the above)
// return (aSmile == bSmile);
是否有任何规则可以解释简短版本?你如何从逻辑 AND 到等于?