#include <stdio.h>

int main() {
    char str[] = "(()()))()";
    int count = 0;
    int i;

    for (i = 0; str[i] != '\0'; i++) {
        if (str[i] == '(') {
            count++;
        }
        if (str[i] == ')') {
            count--;
        }


        if (count < 0) {
            printf("False\n");
            return 0;
        }
    }

    if (count == 0) {
        printf("Ture");
    } else {
        printf("False");
    }

    return 0;
}


Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: