Simpragma interview question

Coding from topcoder