Blackbaud Interview Question

String pattern and stack operation