Returning 0 every time

code- https://ide.codingblocks.com/s/231558
evert time returning 0.

refer to the below code

u have taken s & end wrong
and also the size of array should be equal to board size

could you please help me with my code i can find solution over the internet

i have mentioned the reason

int e= INT_MAX;
int ans=INT_MAX;
int arr[100];
these are wrong

Actuallly then the problem is may be i am not that better in understating it but i am still confused why it is giving correct output and could you please comment and correct mistake in my code because i am not able to understand that code leave the constraints to me just help me correct my logic

okay give me 10 minutes
i`ll make updates to ur code


till then watch his video based on the same concept

@anubhavb11

added comments there are a lot of problem in the code
please watch the video i shared them attempt this one again
similarly the PRATA one

1 Like

okay and thank you very much Chhavi you are so helpful.

1 Like

How can I become a good coder like you? how much time it take i am in 2nd year now but still struggle with coding these problem. How much do you practice its so amazing you get to correct my code so eas;y and so fast.

HI @anubhavb11
sorrry for the late reply
It ` s fine if u are unable to solve these question now, u just need to be regular in your practice u have a lot of time with u
i started quite late at the end of 3rd yr
u are still early in the process
try looking for videos in course or youtube or check out discusiion if u are unable to code / think of a questions solution
do atleast 10 questions a day
try doing atleast 1-2 new question .
start doing question from Leetcode(easy), codechef (begineers)
just dont lose hope,it is time consuming in the beginning but gradually u ll be learn to code.
it took me months to understand things its fine. just be there in the process.
AND Success will be urs

thank you very much i think i was loosing a hope because like i have doing this since 3 months and still i struggle in coding thats why i am so confused and want to leave ds algo and move to dev part

I suggest you try to keep a balance of both,
like give a little for time for DSA since its logic building and will help u in dev if u look at a bigger picture.
try understanding more of the basics. they really help u

Sorry if you think i am asking so much but like i think i want to master ds algo then move forward so i want to know like you started in 3rd year last then how much time have taken you to become this good at coding?

Approx 5-6 months
Try solving as many questions as u can during this interval
Give contest the result should not borther ur participation, try solving those question once the contest ends
Also this is kinda never ending process of mastering DSA each contest teaches u something new
Basic understanding will help you land a decent job in a product based company
Good luck

1 Like

Thank you very much it was great talking with you.

1 Like

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.