Problem Statement | |||||||||||||
My two kids go to different summer camps, and each day we go over their lunch menus. I noticed that both camps have a different set of lunches that repeat on a regular basis. You will be given the repeating menu of lunches for each camp. Each schedule will start at the first element on the first day, which is designated as day zero (0). Return the first day that both camps serve the same lunch, or -1 if they will never serve the same lunch on the same day. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The days start at zero (i.e., the first day of camp is day zero). | ||||||||||||
- | There may be repeats within each individual menu. See Example 2. | ||||||||||||
Constraints | |||||||||||||
- | menu1 and menu2 will each contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of each menu will contain only lower case letters ('a' - 'z') and spaces (' '). | ||||||||||||
- | Each element of each menu will contain between 2 and 50 characters, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
| |||||||||||||
5) | |||||||||||||
|