bool balanced(string s) { stack letters; int open = 0; int close = 0; for (int i=0; i