package leetcode;

/**
 * https://leetcode.com/problems/determine-color-of-a-chessboard-square/
 */
public class Problem1812 {
    public boolean squareIsWhite(String coordinates) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1812 prob = new Problem1812();
        System.out.println(prob.squareIsWhite("a1")); // false
        System.out.println(prob.squareIsWhite("h3")); // true
        System.out.println(prob.squareIsWhite("c7")); // false
    }
}

@@ -187,323 +187,292 @@
     
-// TODO%0A        return false;
+return squareIsWhite(
 %0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1812 prob = new Problem1812(
+    (coordinates.charAt(0) - 'a') + 1,%0A            (coordinates.charAt(1) - '0') + 1
 );%0A    
+%7D%0A%0A
     
-System.out.println(prob.squareIsWhite(%22a1%22)); // false%0A        System.out.println(prob.squareIsWhite(%22h3%22)); // true%0A        System.out.println(prob.squareIsWhite(%22c7%22)); // false
+private static boolean squareIsWhite(int row, int col) %7B%0A        if (row %25 2 == 0) %7B%0A            return col %25 2 == 0;%0A        %7D%0A        return col %25 2 != 0;
 %0A   

Solve problem 1812