leetcode周赛 243–第一题
class Solution {
public boolean isSumEqual(String firstWord, String secondWord, String targetWord) {
String first= "";
String second = "";
String target = "";
for(int i = 0 ; i < firstWord.length() ; i++){
first+=firstWord.charAt(i)-'a';
}
int firstInteger = Integer.parseInt(first);
for(int i = 0 ; i < secondWord.length() ; i++){
second+=secondWord.charAt(i)-'a';
}
int secondInteger = Integer.parseInt(second);
for(int i = 0 ; i < targetWord.length() ; i++){
target+=targetWord.charAt(i)-'a';
}
int targetInteger = Integer.parseInt(target);
if(firstInteger+secondInteger==targetInteger) return true;
return false;
}
}