DEADEND Editorial

Can anyone please tell me what’s wrong in my code

https://www.codechef.com/viewsolution/28007619

I know i can replace the if conditions by increasing length of array by placing some large values
At index 0 and n but i want to know why this code is not working

@super_saiyan1 Yes, You are right BUT else statement works for the nearest if condition (If you ignore the bracket for single statement)

Can anybody explain why the Editorialist code has arr[1<<20] ?

https://www.codechef.com/viewsolution/30711113
please help i use map and add the plants if not filled at -1 or at +1 please help

I am facing problem with my code.My code is partially correct please help…
code link-CodeChef: Practical coding for everyone

I am checking the boundaries (0 and n-1) instead of making the array size =(n+2),but getting WA.
can i get help in my code:
https://www.codechef.com/viewsolution/32203570

In the solution code https://www.codechef.com/viewsolution/33891833 . I have used a array instead of using map.
Can anyone explain why it is getting partially accepted?