2020年6月9日

判断回文数

摘要: class Solution: def isPalindrome(self, x): if str(x).startswith('-'): return False else: a = str(x) b = a[::-1] if a == b: return True else: return Fa 阅读全文

posted @ 2020-06-09 13:01 阿虾 阅读(120) 评论(0) 推荐(0) 编辑

2020年5月18日

pytest插件地址

摘要: http://plugincompat.herokuapp.com/ 阅读全文

posted @ 2020-05-18 13:49 阿虾 阅读(131) 评论(0) 推荐(0) 编辑

jenkins构建时一直提示no mudule XXX, 配了PYTHONPATH还是不行,原来是下载的包与调用的路径不一致导致的

摘要: 参考链接: https://www.centos.bz/2018/10/jenkins%E4%BD%BF%E7%94%A8%E5%BC%80%E5%A7%8B%E8%B8%A9%E5%9D%91%EF%BC%881%EF%BC%89/ 阅读全文

posted @ 2020-05-18 13:34 阿虾 阅读(179) 评论(0) 推荐(0) 编辑

2020年4月20日

返回数值数组的“峰值”(或局部最大值)的位置和值

摘要: 题目描述: # In this kata, you will write a function that returns the positions and the values of the "peaks" (or local maxima) of a numeric array.## For e 阅读全文

posted @ 2020-04-20 13:31 阿虾 阅读(390) 评论(0) 推荐(0) 编辑

2020年4月15日

找到数组或整数列表中连续子序列的最大和

摘要: 题目描述: The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers: maxSequence([- 阅读全文

posted @ 2020-04-15 14:18 阿虾 阅读(337) 评论(0) 推荐(0) 编辑

2020年4月13日

编写一个调用的函数,该函数接受一个括号字符串,并确定括号的顺序是否有效

摘要: 题目描述: Write a function called that takes a string of parentheses, and determines if the order of the parentheses is valid. The function should return 阅读全文

posted @ 2020-04-13 16:48 阿虾 阅读(603) 评论(0) 推荐(0) 编辑

2020年4月10日

返回列表中最长的连续字符串

摘要: 题目描述: # You are given an array strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecutive strings 阅读全文

posted @ 2020-04-10 12:18 阿虾 阅读(454) 评论(0) 推荐(0) 编辑

2020年4月7日

输入一个数字,求每一位相加之和

摘要: 题目描述: # In this kata, you must create a digital root function.## A digital root is the recursive sum of all the digits in a number. Given n, take the 阅读全文

posted @ 2020-04-07 20:06 阿虾 阅读(476) 评论(0) 推荐(0) 编辑

判断一个数是否为素数

摘要: 我的解答: import mathdef is_prime(n): if n > 1: if n == 2: return True if n % 2 == 0: return False for current in range(3, int(math.sqrt(n) + 1), 2): if n 阅读全文

posted @ 2020-04-07 16:57 阿虾 阅读(226) 评论(0) 推荐(0) 编辑

编写一个函数,它接受一个或多个单词的字符串,并返回相同的字符串,但所有五个或多个字母的单词都颠倒过来

摘要: 题目描述: # Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Ju 阅读全文

posted @ 2020-04-07 16:53 阿虾 阅读(815) 评论(0) 推荐(0) 编辑

导航