Given a lowercase string text, return true when it reads the same forwards and backwards.
Is the Text a Palindrome? (Set 3) — the data. This set runs 4 cases: text is a string of 2–7 characters. The hidden cases are the largest of the set.
Example 1
isPalindromeText()
Input
text ="vuvz"
Output
false
Why
`isPalindromeText` returns `false`forthisinput.
Example 2
isPalindromeText()
Input
text ="ss"
Output
true
Why
`isPalindromeText` returns `true`forthisinput.
Constraints
0<=text.length<=10^5`text` contains lowercase letters only.
Every caseinthisset 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.