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 | 605 Views, 26016 Search Bots | 57 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 605 Views, 26016 Search Bots | 57 Words
| Browse | Archive
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 | 605 Views, 26016 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
Related Articles
- Algorithm Interview: Determine If Linked List is Palindrome
- Daily Interview Problem: Jump to the End
- Algorithm Interview: Permutations of numbers
- Consecutive Ones
- ImageMagick Vulnerabilities - CVE-2016–3714
- Daily Interview Problem: Buddy Strings
- Daily Interview Problem: Min Stack
- Detect Linked List Cycle
- Daily Interview Problem: 3 Sum
- Daily Interview Problem: Largest BST in a Binary Tree
©2006~2024 SteakOverCooked - 0.00815 Seconds(s) - 2206.192 KB/s - 30 Online Memory: 491.4 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" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !