Is the Text a Palindrome? (Set 2)

Easy

Given a lowercase string text, return true when it reads the same forwards and backwards.

Is the Text a Palindrome? (Set 2) — the data. This set runs 4 cases: text is a string of 4–5 characters. The hidden cases are the largest of the set.

Example 1

isPalindromeText()
Input
text = "rexz"
Output
false

Why

`isPalindromeText` returns `false` for this input.

Example 2

isPalindromeText()
Input
text = "uwozz"
Output
false

Why

`isPalindromeText` returns `false` for this input.
Constraints
0 <= text.length <= 10^5
`text` contains lowercase letters only.
Every case in this set must pass: the first two are visible on Run, the last two unlock on Submit.

Topics

StringsTwo Pointers

Implement isPalindromeText in the editor and return the answer — printing it is never graded.