Leetcode in Java && Oracle
421 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-01_17-03-45.png
28.1 KB
#N1812. Determine Color of a Chessboard Square
problem link=>https://leetcode.com/problems/determine-color-of-a-chessboard-square/

#solution
class Solution {
public boolean squareIsWhite(String coordinates) {
int letter=coordinates.charAt(0)-97;
int num=coordinates.charAt(1)-49;

if((letter+num)%2==0)
return false;
return true;
}
}