https://ide.codingblocks.com/#/s/16246
answer is coming out to be 0. please tell me the mistake in my code
question link: https://hack.codingblocks.com/contests/c/452/408
https://ide.codingblocks.com/#/s/16246
answer is coming out to be 0. please tell me the mistake in my code
question link: https://hack.codingblocks.com/contests/c/452/408
Yeah ! , of course you was getting zero because you written wrong statement in line no 12 (equality in wrong place ) and but that is not only the issue , you have to check wheather the current element of the array is less than or equal to current answer in boolean function or not , if not you need to return false because this cannot be your answer .
Here i modified ur code
https://ide.codingblocks.com/#/s/16263