This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement a method find that given two lists will find the starting index (indexing is zero based) where the second list occurs as a sub-list in the first list. Your implementation should return -1 if the sub-list cannot be found. Arguments are always defined, non-empty lists. | |
Sample Input 1 | |
list1 = (1, 2, 3) | |
list2 = (2, 3) | |
Sample Output 1 | |
1 |