Class assignment doubt

wrong answer

@rohit_1906
your logic is correct but there is mistake in code while printing output. Here you don’t have to print “#n : ans” but you have to print “#testcase_number : ans”.
Just initialise int tc=1; outside while loop. and change lin 79 to cout<<"#"<<tc++<<" : "<<u<<endl;
your code will work

@rohit_1906
As I can see you have successfully submitted the code. Please mark this doubt as resolved.