Driver code problem

i am unable to write the main function for the code given in editorial

hello @Divit-Goel-2940158062683318
u just have to write code for taking required input in the main and then call the function given in editorial.

https://ide.codingblocks.com/s/260947 can anyone give me the dry run for the given code

refer this algorithm visualizer given on this page for dry run-> visualize

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.