1812. 判断国际象棋棋盘中一个格子的颜色
class Solution {
public boolean squareIsWhite(String str) {
int a = str.charAt(0) - 'a' + 1;
int b = str.charAt(1) - '0';
return (a + b) % 2 == 1;
}
}
class Solution {
public boolean squareIsWhite(String str) {
int a = str.charAt(0) - 'a' + 1;
int b = str.charAt(1) - '0';
return (a + b) % 2 == 1;
}
}