Validate the Reversible Reference

Intermediate

A reference-number scheme is designed to read identically forwards and backwards as a self-check. Verify whether a given reference is valid under that rule.

Implement `solve(String input)` to return true if `input` reads the same forwards and backwards, false otherwise.

Examples

Input"racecar"
Outputtrue
Input"apex"
Outputfalse
Hints
  • Compare characters from both ends inward; any mismatch means it is not a palindrome.
Anonymous Apex

Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.