Amazon interview question

For loop, string and char extraction through various methods and apply time complexity and evaluate