Accenture Interview Question

One coding question. Count a string