Example #1
0
 def test_1(self):
     s = 'barfoothefoobarman'
     words = ['foo', 'bar']
     self.assertCountEqual(find_substring(s, words), [0, 9])
Example #2
0
 def test_6(self):
     s = ''
     words = []
     self.assertCountEqual(find_substring(s, words), [])
Example #3
0
 def test_4(self):
     s = 'wordgoodgoodgoodbestword'
     words = ['word', 'good', 'best', 'good']
     self.assertCountEqual(find_substring(s, words), [8])
Example #4
0
 def test_5(self):
     s = 'lingmindraboofooowingdingbarrwingmonkeypoundcake'
     words = ['fooo', 'barr', 'wing', 'ding', 'wing']
     self.assertCountEqual(find_substring(s, words), [13])
Example #5
0
 def test_3(self):
     s = 'barfoofoobarthefoobarman'
     words = ['bar', 'foo', 'the']
     self.assertCountEqual(find_substring(s, words), [6, 9, 12])