My solution: https://ide.codingblocks.com/s/433908
Question: https://online.codingblocks.com/app/player/178555/content/173733/4761/code-challenge
Getting expected answers for all values of n while compiling, but getting wrong answers for all test cases while submitting my solution.