Recently I was asked this question on interview and I didn\'t know how to answer it.
Can anyone answer this question and describe it?
I would assume that function is O(n) because it would need to iterate through the string once.