Pregunta de entrevista de Unisys

Writing an algorithm for the given test case in 3 ways.1. Best,2.Average,2.Worst .