SAMPLE OUTPUT SEEMS TO BE WRONG

Sir the sample output for the given input is given as 4 2 6 3.But it should be 4 5 6.Can you please explain?

Sir I meant that the output for the given input should be 4 5 6 but here in the sample output its showing to be 4 2 6 3

@Mukul-Shane-1247687648773500,
image
see this 4 2 (5 or 6 ) 3 {since question says take right most so 6 not 5}

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.