Click Here to go back to the homepage.

Yin and Yang Stones Solution:


#include <stdio.h>

int main(void) {
    char input[100001];
    char* ptr = input;
    int ctr = scanf("%s", input);
    while(*(ptr)++ == 'W' ? ++ctr && *ptr : *ptr);
    printf("%d", (--ctr << 1 == ptr - &(input[0])));
}