Kindly guide me for implementation

https://www.codechef.com/TRCK2021/problems/VTOYS

my logic -
if the number of -ve nos is even then multiply all the ai (ai must not be zero)
else
if the number of -ve nos is odd then multiply all nos except for the ai=0 and when ai is the min negtive number (magnitude wise)

i think the approach is correct but i was not getting wa
this happens quite a lot of times i am able to make logic but my code is falty
which kind of problems should i practice to solve this problem??

hello @laksh.rustagi12

just keep practicing, with time u will get good at it.

the problem that u have shared has corner cases,so make a habit to find and handel all corner cases

whenever I write a code containing multiple functions and quite complex working, it never ever works fine in first go , I need to do 3-4 dry runs on average, how to decrease this inefficiency?

only through practice u can overcome this

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.