Work’s fine and executes but on submission throws an error as wrong answer
Bro, Just add ( int min =Integer.MAX_VALUE; )
inside the while loop of t you will get AC!
this is your AC code- CodeChef: Practical coding for everyone
You were not initializing min to Integer.MAX_VALUE for every test case!
Thanks will try it and let you know…
Thanks for the help
Tried it dude still stuck with same error Can you please tell me what’s wrong with my while loop correcting that prompts me right answer
What would happen if t=1000?
I have even tried <= 1000 still throws a wrong answer @everule1
You just write while(t!=0) for the test case or while(t>0 && t<=1000).
if t=1000 your code will have WA.
Just see the solution i posted.This is your solution but i edited and got an AC.