JAVA_LeetCode 1812_Determine Color of a Chessboard Square 풀이 class Solution { public boolean squareIsWhite(String coordinates) { // 문자열의 각 문자를 더해서 2로 나눴을 때 0이면 true, 1이면 false를 반환 int num1 = coordinates.charAt(0) - 'a'; int num2 = coordinates.charAt(1); if ((num1 + num2) % 2 == 0) return true; return false; } } * 출처 https://leetcode.com/problems/determine-color-of-a-chessboard-square...
JAVA_LeetCode 1812_Determine Color of a Chessboard Square에 대한 요약내용입니다.
자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.