Code for this algo

I need code of the this algorithm.

Hey @abhayguptag7, here is the code,

Happy Learning
Plz mark the doubt as resolved :blush: