Pregunta de entrevista de Synopsys

basically coding style and simple algorithm design.