Skip to content

Instantly share code, notes, and snippets.

View SyedRaza's full-sized avatar

Syed Raza Khalid SyedRaza

View GitHub Profile
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