Solve this problem on our Practice Portal:
https://practice.geeksforgeeks.org/pr...
Let us know if you have any questions related to explanation or understanding in the comments section.
𝗚𝗲𝘁 𝗵𝗶𝗿𝗲𝗱 𝘄𝗶𝘁𝗵 𝘂𝘀 - https://practice.geeksforgeeks.org/jo...
𝗥𝗲𝗮𝗱 𝗳𝗲𝗮𝘁𝘂𝗿𝗲𝗱 𝗔𝗿𝘁𝗶𝗰𝗹𝗲𝘀- https://www.geeksforgeeks.org/