![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
魔羯座巧格格
这个作者很懒,什么都没留下…
展开
-
LeetCode7.整数反转(Python3)
题目给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。示例 1:输入: 123输出: 321示例 2:输入: -123输出: -321示例 3:输入: 120输出: 21注意:假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−231 ,231− 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/reverse-integer著作权原创 2020-11-05 17:49:44 · 87 阅读 · 0 评论 -
LeetCode1.两数之和(Python3)
class Solution:def twoSum(self, nums: List[int], target: int) -> List[int]:n = len(nums)for i in range(n):for j in range(i+1,n):if nums[i] + nums[j] == target:return i, jelse:continue欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Ma原创 2020-11-05 17:05:56 · 184 阅读 · 0 评论