Black or White

Imagine an infinite chess board. The cell on the bottom-left most corner is labelled (0,0). The cell…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

Here is a simple solution in C++

#include<iostream>
#include<string>
using namespace std;

int main(){
    string index1,index2;
    string black="Black";
    string white="White";
    cin >> index1 >>index2;
    int A=index1.back()-'0';
    int B=index2.back()-'0';
    if((A+B)%2==0){
        cout << black <<endl;
    }
    else{
        cout << white <<endl;
    }
}