Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 531 Bytes

File metadata and controls

21 lines (17 loc) · 531 Bytes

Palindrome Check

Source: https://www.algoexpert.io/questions/palindrome-check
Difficulty: Easy
Category: Strings


Write a function that takes in a non-empty string and that returns a boolean representing whether the string is a palindrome.

A palindrome is defined as a string that's written the same forward and backward. Note that single-character strings are palindromes.

Sample Input:

string = "abcdcba"

Sample Output:

true // it's written the same forward and backward