Amazon interview question

Question on prefix sufix medium