![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
【LeetCode】python刷题笔记
喵喵喵苗~
这个作者很懒,什么都没留下…
展开
-
【LeetCode】709.转换成小写字母
运用python3实现函数 ToLowerCase(),该函数接收一个字符串参数 str,并将该字符串中的大写字母转换成小写字母,之后返回新的字符串。示例 1:输入: "Hello"输出: "hello"示例 2:输入: "here"输出: "here"示例3:输入: "LOVELY"输出: "lovely"代码如下:class Sol...原创 2019-03-29 17:40:27 · 151 阅读 · 0 评论 -
【LeetCode】1.两数之和
用python3解决给定一个整数数组 nums和一个目标值 target,请你在该数组中找出和为目标值的那两个整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。class Solution: def twoSum(self, nums: List[int], target: int) -> List[i...原创 2019-03-30 21:14:51 · 161 阅读 · 0 评论 -
【LeetCode】7.整数反转
7.整数反转给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。示例1:输入: 123输出: 321示例 2:输入: -123输出: -321示例 3:输入: 120输出: 21注意:假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为[−231, 231− 1]。请根据这个假设,如果反转后整数溢出那么...原创 2019-04-08 18:58:22 · 128 阅读 · 0 评论