3 char cmap
[] = { [')']='(', [']']='[', ['}']='{', ['>']='<' };
4 int score
[] = { [')']=3, [']']=57, ['}']=1197, ['>']=25137 };
6 int parse_line(char *buf
)
10 for (char *p
= buf
; *p
!= '\0'; p
++) {
26 if (stack
[--sp
] != cmap
[(int)*p
]) {
27 return score
[(int)*p
];
43 while (getline(&buf
, &len
, stdin
) != -1)