Trantor interview question

pattern printing problem