Greedy
2.Medium
(55)Jump Game
(253)Meeting Rooms II
(406)Queue Reconstruction by Height
(581)Shortest Unsorted Continuous Subarray
(621)Task Scheduler
(680) Valid Palindrome II
1 2 3 4 5 6 7 8 9
| class Solution(object): def validPalindrome(self, s): l,r=0,len(s)-1 while l<r: if s[l]!=s[r]: return s[l+1:r+1] == s[l+1:r+1][::-1] or s[l:r] == s[l:r][::-1] l+=1 r-=1 return True
|
Palindrome questions:
(9) Palindrome Number
(345) Reverse Vowels of a String
(680) Valid Palindrome II