Code:
class Solution:
def isPalindrome(self, x: int) -> bool:
e=str(x);
a=list(e);
a.reverse();
w="".join(a);
if(e==w):
return True;
else:
return False;
Prerequisite: Single Number | Practice Problem on List | Python | Castor Classes: https://www.youtube.com/watch?v=mIQBl... Single Number II | Practice Problem on List | Python | Castor Classes https://www.youtube.com/watch?v=qnBML... Single Number III | LeetCode | Practice Problem on List | Python | Castor Classes https://www.youtube.com/watch?v=8JEUM... List in Python | Part 1 | Castor Classes: https://www.youtube.com/watch?v=P2ogQ... List in Python | Part 2 | Castor Classes: https://www.youtube.com/watch?v=vNxxQ... List in Python | Part 3 | Castor Classes https://www.youtube.com/watch?v=aUfow... Iterate over a list & string | List in Python | Part 4 | Castor Classes https://www.youtube.com/watch?v=4Zrfk... Convert list to string | List in Python | Part 5 | Castor Classes https://www.youtube.com/watch?v=mLHOF... Python for beginners: https://www.youtube.com/watch?v=egq7Z...
class Solution:
def isPalindrome(self, x: int) -> bool:
e=str(x);
a=list(e);
a.reverse();
w="".join(a);
if(e==w):
return True;
else:
return False;
Prerequisite: Single Number | Practice Problem on List | Python | Castor Classes: https://www.youtube.com/watch?v=mIQBl... Single Number II | Practice Problem on List | Python | Castor Classes https://www.youtube.com/watch?v=qnBML... Single Number III | LeetCode | Practice Problem on List | Python | Castor Classes https://www.youtube.com/watch?v=8JEUM... List in Python | Part 1 | Castor Classes: https://www.youtube.com/watch?v=P2ogQ... List in Python | Part 2 | Castor Classes: https://www.youtube.com/watch?v=vNxxQ... List in Python | Part 3 | Castor Classes https://www.youtube.com/watch?v=aUfow... Iterate over a list & string | List in Python | Part 4 | Castor Classes https://www.youtube.com/watch?v=4Zrfk... Convert list to string | List in Python | Part 5 | Castor Classes https://www.youtube.com/watch?v=mLHOF... Python for beginners: https://www.youtube.com/watch?v=egq7Z...
0 Comments:
Post a Comment