ALG-E006EasyStrings
Mirror Word Check
Return true when text reads identically forward and backward. The comparison is case-sensitive and includes spaces.
Contract
input text: string
return boolean
Constraints
- • 0 <= text length <= 1000
Examples
Example 1
text = "level"
→ true
Example 2
text = "hello"
→ false
5 judge tests (2 shown above). Target complexity: O(n).