1812. Determine Color of a Chessboard Square

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1812

class Solution:
    def squareIsWhite(self, coordinates: str) -> bool:
        return (ord(coordinates[0]) + ord(coordinates[1])) % 2 == 1