![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
王安安
100个小算法
展开
-
3、Determine whether an integer is a palindrome
class Solution(object): def isPalindrome(self, x): srcStr = str(x) reverseStr = srcStr[::-1] return srcStr == reverseStr """ :type x: int :rt原创 2017-10-24 23:54:44 · 231 阅读 · 0 评论 -
4、Write a function to find the longest common prefix string amongst an array of strings
class Solution(object): def longestCommonPrefix(self, strs): shortest_string = "" for member in strs: if (shortest_string == "") or (len(member) s原创 2017-10-27 17:55:06 · 518 阅读 · 0 评论 -
1、找到数组里两个数字之和为某个值
原创 2017-10-20 19:14:51 · 312 阅读 · 0 评论 -
2、Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Note:The input is assumed to be a 32-bit signed integer. Your function s原创 2017-10-22 00:26:39 · 113 阅读 · 0 评论