Bob Pattern

This is a small exercise in finding a pattern inside a string: the first and last characters matter, but the middle can be anything. Write a function bob_there that takes a string s and looks for a three-character fragment. Return True if there is a pattern b + any character + b anywhere in the string, otherwise return False.

Примеры

Ввод
"abcbob"
Вывод
True
Ввод
"b9b"
Вывод
True
Ввод
"aaa"
Вывод
False

Нужно реализовать

def bob_there(s: str) -> bool:

Теги

strings
PostgreSQLv16

Šeit parādīsies koda izpildes rezultāts

Visible tests
1
Input
"abcbob"
ExpectedTrue
2
Input
"b9b"
ExpectedTrue
3
Input
"aaa"
ExpectedFalse
4
Input
"bob"
ExpectedTrue
5
Input
"bxb"
ExpectedTrue
6
Input
"b b"
ExpectedTrue
Focus radio
Paused · SomaFM · Fluid