Accenture interview question

One coding question. Count a string