File: root - text - article - 2020 - 02 - palindrome-integers.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 347 Views, 22339 Search Bots | 57 Words
| Browse | Archive
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 347 Views, 22339 Search Bots | 57 Words
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Hi, here's your problem today. This problem was recently asked by Twitter:
Given an integer, check if that integer is a palindrome. For this problem do not convert the integer to a string to check if it is a palindrome.
import math
def is_palindrome(n):
# Fill this in.
print is_palindrome(1234321)
# True
print is_palindrome(1234322)
# False
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 347 Views, 22339 Search Bots | 57 Words Given an integer, check if that integer is a palindrome. For this problem do not convert the integer to a string to check if it is a palindrome.
import math
def is_palindrome(n):
# Fill this in.
print is_palindrome(1234321)
# True
print is_palindrome(1234322)
# False
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Related Articles
- Skip the readings, focus on problems. And use all the hints!
- Non-decreasing Array with Single Modification
- Daily Interview Problem: Tree Serialization
- Daily Interview Problem: Largest BST in a Binary Tree
- Find Pythagorean Triplets
- Algorithm Interview: Maximum Path Sum in Binary Tree
- Daily Interview Problem: Reconstrunct Binary Tree from Preorder and Inorder Traversals
- Reverse a Directed Graph
- Algorithm Interview: Smallest Number that is not a Sum of a Subset of List
- Print a tree level-by-level, with line-breaks
©2006~2024 SteakOverCooked - 0.01275 Seconds(s) - 1528.403 KB/s - 28 Online
Memory: 493.07 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />
![](/images/top.jpg)
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !