Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d357891

Browse files
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
  • Algorithms/Easy/1078_OccurrencesAfterBigram

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)

AltStyle によって変換されたページ (->オリジナル) /