There’s something wrong with my approach. Please help me identify my mistake.
My solution: https://ide.codingblocks.com/s/476113
Question: https://online.codingblocks.com/app/player/178555/content/173732/4925/code-challenge
Getting correct answer when compiling with e.g. given.
But, failing all test cases.