680. Valid Palindrome II Easy

@problem@discussion
#Two Pointers#String#Greedy



1/**
2 * [680] Valid Palindrome II
3 *
4 * Given a string s, return true if the s can be palindrome after deleting at most one character from it.
5 *  
6 * Example 1:
7 * 
8 * Input: s = "aba"
9 * Output: true
10 * 
11 * Example 2:
12 * 
13 * Input: s = "abca"
14 * Output: true
15 * Explanation: You could delete the character 'c'.
16 * 
17 * Example 3:
18 * 
19 * Input: s = "abc"
20 * Output: false
21 * 
22 *  
23 * Constraints:
24 * 
25 * 	1 <= s.length <= 10^5
26 * 	s consists of lowercase English letters.
27 * 
28 */
29pub struct Solution {}
30
31// problem: https://leetcode.com/problems/valid-palindrome-ii/
32// discuss: https://leetcode.com/problems/valid-palindrome-ii/discuss/?currentPage=1&orderBy=most_votes&query=
33
34// submission codes start here
35
36impl Solution {
37    pub fn valid_palindrome(s: String) -> bool {
38        false
39    }
40}
41
42// submission codes end
43
44#[cfg(test)]
45mod tests {
46    use super::*;
47
48    #[test]
49    fn test_680() {
50    }
51}
52


Back
© 2025 bowen.ge All Rights Reserved.