Clarification needed for this problem


#1

Example
Input 1:
A = “barfoothefoobarman”
B = [“foo”, “bar”]
Expected Output 1:
[0, 9]
Why can’t the output be [0, 3] or [9, 12]? As per question description this should be accepted.

Input 2:
S = “catbatatecatatebat”
L = [“cat”, “ate”, “bat”]
Expected Output 2:
[0, 3, 9]
Shouldn’t the output be [0, 3, 6] or [0, 3, 12]. In above output is 0 (cat), 3 (bat) and 9(cat - again), why no indexes returned for ‘ate’ ?

Also, what should be the output if string in B is not found?