#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
bool solution(const char* s) {
int left = 0, right = 0;
if (*s == ')')
return false;
while (*s) {
if (*s == '(')
left++;
else if (*s == ')' && left > right)
right++;
else
return false;
s++;
}
return (left == right) ? true : false;
}