📜

Palindrome Check

Palindrome Check
보통 문자열 +20pts

Problem

Write a function that checks if a string is a palindrome (reads the same forwards and backwards).

Examples

Input: isPalindrome("racecar")
Output: true
Input: isPalindrome("hello")
Output: false

Explanation

이 문제는 **회문(palindrome) 판별 알고리즘**을 학습합니다. 회문은 앞에서 읽으나 뒤에서 읽으나 같은 문자열입니다. **기본 접근법: 뒤집어서 비교** 1. 문자열을 소문자로 통일 (대소문자 무시를 위해) 2. 문자열을 뒤집기 3. 원본과 뒤집은 문자열 비교 **예시: "racecar"** - 소문자: "racecar" - 뒤집기: "racecar" - 비교: "racecar" === "racecar" → true **예시: "hello"** - 소문자: "hello" - 뒤집기: "olleh" - 비교: "hel...

View detailed explanation →

Key Concepts

회문 알고리즘 문자열 비교 대소문자 정규화 투 포인터 기법
Time: O(n) Space: O(n)
solution.js
Ctrl + Enter
Run tests to see results here.