Pergunta de entrevista da empresa Epic

Write a code to indent a block of code (something which is done by IDEs such as visual studio) .I was given a few programming constructs such as if else, for construct and a funciton block. Special cases to handle : nested if