Valid Palindrome II(dfs带while循环)
Given a non-empty strings, you may deleteat mostone character. Judge whether you can make it a palindrome.
Example 1:
Input:
"aba"
Output:
TrueExample 2:
Input:
"abca"
Output:
True
Explanation:
You could delete the character 'c'.分析
带有while循环的递归,递归完全发生在while里面,参见dfs的for loop
注意python的ternary
iterative
PreviousMaximum Sum of 3 Non-Overlapping Subarrays(dp)NextLongest Continuous Increasing Subsequence(dp)
Last updated
Was this helpful?