Question
What is the time complexity of the above code?
Answer: Option B
Was this answer helpful ?
All the characters in the string have to be processed, hence the complexity is O(n).
Was this answer helpful ?
Submit Solution