Leetcode Çözümleri | Valid Palindrome II

Leetcode içerisinde bulunan “Valid Palindrome II” sorusunun açıklaması ve çözümü. Bu soruda size verilen bir string için, en fazla 1 karakter silerek palindrom yapılıp yapılamayacağı soruluyor. En fazla denildiği için hiç karakter silmeyebilirsiniz tabi.

➡️ Leetcode Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/

➡️ Problem açıklaması:

Given a string s, return true if the s can be palindrome after deleting at most one character from it.

Example 1:

Input: s = “aba”

Output: true

Example 2:

Input: s = “abca”

Output: true

Explanation: You could delete the character ‘c’.

Example 3:

Input: s = “abc”

Output: false

Constraints:

1 <= s.length <= 10^5

s consists of lowercase English letters.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.