๐งช Programming
โฑ๏ธ 40s
๐ 273 chars
๐ฆ 8.2B
๐ง Q4_K_M
Prompt: Write a Python function is_palindrome(s) that returns True if s is a palindrome. One test case.
Response
```python
def is_palindrome(s):
left, right = 0, len(s) - 1
while left < right:
if s[left] != s[right]:
return False
left += 1
right -= 1
return True
# Test case
print(is_palindrome("racecar")) # Expected output: True
```