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 | 608 Views, 26080 Search Bots | 57 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 608 Views, 26080 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 | 608 Views, 26080 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
- Consecutive Ones
- PHP Unit Tests on VPS Server
- Daily Interview Problem: Merge Overlapping Intervals
- Daily Interview Problem: Decode String
- Skip the readings, focus on problems. And use all the hints!
- Daily Interview Puzzle: Minimum Size Subarray Sum
- Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
- Plus One
- Daily Interview Problem: Reverse Words in a String
- Daily Interview Puzzle: Falling Dominoes
©2006~2024 SteakOverCooked - 0.0087 Seconds(s) - 2285.078 KB/s - 37 Online Memory: 492.82 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="index, 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 !