Ctrl K

A Pair in the Mirror

Easy
You are given a string text. Reverse it. Return True if some two adjacent letters of the original string also appear next to each other, in the same order, in the reversed string. Otherwise return False. For example, "seen" contains the pair "ee", and so does "nees".
Example 1
text='rotor' → True

The word reads the same both ways, so any pair, such as "ro", also appears in the reversed string.

Example 2
text='plum' → False

The reversed string is "mulp" with pairs "mu", "ul" and "lp"; none of them matches "pl", "lu" or "um".

Example 3
text='bonobo' → True

The pair "ob" occurs in "bonobo", and the reversed string "obonob" starts with it.

Constraints
  • 1 ≤ len(text) ≤ 100
  • text consists of lowercase English letters
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsValue of a Roman Numeral EasySame Letter Cipher EasySame Letters, Reshuffled EasySame When Flipped EasyShuffle Into a Palindrome Easy
loading Python…
Input
text='rotor'
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 124 tests on the server, hidden ones included.