Skip to content

Commit d357891

Browse files
authored
Added Python solution for 1078. OccurrencesAfterBigram (#116)
* Added Python solution for 1078. OccurrencesAfterBigram * Changes added to Python solution for 1078. OccurrencesAfterBigram * Changes added to Python solution for 1078. OccurrencesAfterBigram
1 parent 87b02fc commit d357891

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def findOcurrences(self, text: str, first: str, second: str) -> List[str]:
3+
array_of_words = text.split()
4+
third_words = list()
5+
6+
for i in range(1, len(array_of_words) - 1):
7+
if array_of_words[i] == second and array_of_words[i - 1] == first:
8+
third_words.append(array_of_words[i + 1])
9+
10+
return third_words

0 commit comments

Comments
 (0)