Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Check String Palindrome
00:00
5 left

Check String Palindrome

EasyPython

Problem

Given a string s, write a function that returns true if s is a palindrome and false otherwise. A palindrome reads the same forward and backward. Compare characters exactly as given, including case and spaces.

Constraints

  • 0 <= len(s) <= 10^5
  • s contains ASCII characters
  • Compare characters exactly as given, including case and spaces

Function Signature

def is_palindrome(s):
Interviewer

Your question is Check String Palindrome. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.