Can you please provide the code for modified approach

can you please explain and provide the code for modified approach , can’t understand from the hint.

hi @aditya12679 https://ide.codingblocks.com/s/326343

can you please explain it a little bit

@aditya12679 its the same as explained in the hint video