Loading...

[LeetCode] 125. valid palindrome (javascript)

leetcode.com/problems/valid-palindrome/submissions/ 1. 정규표현식 이용하지 않음. 대문자로 변환한 뒤 if문으로 문자와 숫자 검사 s=s.toUpperCase(); arr=[] for(let i=0;i='A' && s[i]='0'&& s[i]

680. Valid Palindrome II

Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Example 2: Input: "abca" Output: True Explanation: You could delete the character 'c'. Note: The string will only contain lowercase characters a-z. The maximum length of the string is 50000. 1. 브루트포스 풀이 (시간 초과) 처음에 이렇게 풀었더니 시간 초과가 나왔다. 배열의 길이가 O(n)인데 ..