PROBLEM LINK:
Author: Bhagya Kamal Jain
Tester: Jatin Yadav
Editorialist: Bhagya Kamal Jain
DIFFICULTY:
EASY
PREREQUISITES:
Greedy, Strings
PROBLEM:
You are given a string and you have to tell whether it is can be generated by the tour.
QUICK EXPLANATION:
Simply iterate over the string and move through corresponding cities.
EXPLANATION:
When you process the given string jump in between the cities according to the current character. If at the end of the string If the tour ends at the green city output YES.
ALTERNATE EXPLANATION:
BONUS
You may notice that only the strings ending with ‘1000’ are accepted.