Most of the time we come across this programming question in coding contests. Companies like Amazon would ask this question in the level 1 coding test.
1) please do not advertise your social media in your posts/repls.
2) this isn't so much of a tutorial as it is a commented program. for tutorials, you should try to put the step-by-step parts in the post description