https://hack.codingblocks.com/contests/c/509/194
https://ide.codingblocks.com/s/35257
only 6 out of 10 cases passed.
https://hack.codingblocks.com/contests/c/509/194
https://ide.codingblocks.com/s/35257
only 6 out of 10 cases passed.
Your logic is a bit wrong
When the input is
5
5 4 5 7 6
Your code gives output
true
which is wrong