Code for Reference

hey it’ll be a great help if u will give me code for reference for this problem.

sure ,refer to this:


if this solves your doubt please mark it as resolved :slight_smile: