Empty strings and None are both falsy.
Simplified code.
class Kata{ public static String verifySum(String nameOne, String nameTwo) { if (nameOne == null || nameTwo == null) return "NULL"; else return nameOne.chars().sum() == nameTwo.chars().sum() ? "TRUE" : "FALSE"; } }
- class Kata{
- public static String verifySum(String nameOne, String nameTwo) {
if (nameOne == null || nameTwo == null) {return "NULL";}return nameOne.chars().sum() == nameTwo.chars().sum() ? "TRUE" : "FALSE";- if (nameOne == null || nameTwo == null) return "NULL";
- else return nameOne.chars().sum() == nameTwo.chars().sum() ? "TRUE" : "FALSE";
- }
- }