https://www.acwing.com/activity/content/code/content/2917808/

alt