Leetcode 7. Median of Two Sorted Arrays The Solution of Python
来源:互联网 发布:淘宝店铺主页 编辑:程序博客网 时间:2024/06/05 20:27
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Note:
The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reversed integer overflows.
Python:
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ x=int(str(x)[::-1]) if x>=0 else 0-int(str(abs(x))[::-1]) return 0 if x>2**31-1 or x<-2**31 else x
速度不是很快,但是行数少,这道题简单,没啥好说的。
0 0
- Leetcode 7. Median of Two Sorted Arrays The Solution of Python
- Leetcode 4. Median of Two Sorted Arrays The Solution of Python
- Median of Two Sorted Arrays -- leetcode -- Python
- 【Leetcode】【python】Median of Two Sorted Arrays
- LeetCode #4 Median of Two Sorted Arrays C# Solution
- 【LeetCode with Python】 Median of Two Sorted Arrays
- [LeetCode]2 Median of Two Sorted Arrays (C++,Python实现)
- 4.Median of Two Sorted Arrays Leetcode Python
- leetcode 日经贴,python code -Median of Two Sorted Arrays
- [Leetcode]4. Median of Two Sorted Arrays @python
- 【LeetCode-Algorithm】【4-Median of Two Sorted Arrays】【Python】
- LeetCode 4.Median of Two Sorted Arrays (Python)
- 【leetcode】4. Median of Two Sorted Arrays(Python & C++)
- LeetCode: Median of Two Sorted Arrays
- LeetCode Median of Two Sorted Arrays
- leetcode 26: Median of Two Sorted Arrays
- Leetcode 4 Median of Two Sorted Arrays
- [Leetcode] Median of Two Sorted Arrays
- paho.mqtt.javascript 断开问题
- 蓝桥杯 矩阵翻硬币
- 大数阶乘
- 数据结构 —— 线性表
- Linux小记(三)
- Leetcode 7. Median of Two Sorted Arrays The Solution of Python
- HNOI 2008 玩具装箱TOY 斜率优化dp
- 提取灵格斯里ld2格式词典的内容
- 常见网络命令之Ping命令
- 【主席树】【线段树】Data Structure Special Training 2 T3 intkth 题解
- 添加数据库
- Java 继承
- bzoj3926:[Zjoi2015]诸神眷顾的幻想乡(后缀自动机)
- 数组应用-三子棋