leetcode python 007
## 翻转整数
def evert(int0):
if int0<0:
flg=1
else:
flg=0
e=int(str(int0)[flg:][::-1])
return e*(-1)**flg
int0=-1499851571
print(evert(int0))
leetcode python 007的更多相关文章
- Leetcode Python Solution(continue update)
leetcode python solution 1. two sum (easy) Given an array of integers, return indices of the two num ...
- LeetCode python实现题解(持续更新)
目录 LeetCode Python实现算法简介 0001 两数之和 0002 两数相加 0003 无重复字符的最长子串 0004 寻找两个有序数组的中位数 0005 最长回文子串 0006 Z字型变 ...
- [LeetCode][Python]Container With Most Water
# -*- coding: utf8 -*-'''https://oj.leetcode.com/problems/container-with-most-water/ Given n non-neg ...
- LeetCode Python 位操作 1
Python 位操作: 按位与 &, 按位或 | 体会不到 按位异或 ^ num ^ num = 0 左移 << num << 1 == num * 2**1 右移 & ...
- 【leetcode❤python】Sum Of Two Number
#-*- coding: UTF-8 -*- #既然不能使用加法和减法,那么就用位操作.下面以计算5+4的例子说明如何用位操作实现加法:#1. 用二进制表示两个加数,a=5=0101,b=4=0100 ...
- [Leetcode][Python]56: Merge Intervals
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 56: Merge Intervalshttps://oj.leetcode. ...
- [Leetcode][Python]55: Jump Game
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 55: Jump Gamehttps://leetcode.com/probl ...
- [Leetcode][Python]54: Spiral Matrix
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 54: Spiral Matrixhttps://leetcode.com/p ...
- [Leetcode][Python]53: Maximum Subarray
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 53: Maximum Subarrayhttps://leetcode.co ...
随机推荐
- Python记录10:模块
''' 1. 什么是模块 模块就一系列功能的集合体 模块有三种来源: 1. 内置的模块 2. 第三方的模块:pip install +模块名称 ...
- DX9 DirectX 索引缓存(IndexBuffer) 代码
// @time: 2012.3.22 // @author: jadeshu // des: 索引缓存 //包含头文件 #include <Windows.h> #include < ...
- cookies增删改擦操作
//判断是否存在名为aaa的cookie function hasSetCookie(name){ var strCookie = document.cookie; var arrCookie = s ...
- rocket mq知识点
1 消费类型 广播消费 : 一条消息被多个消费者消费 集群消费:一个 Consumer Group 中的 Consumer 实例平均分摊消费消息.例如某个 Topic 有 9 条消息,其中一个 Con ...
- Centos 编译 安装 criu
下载依赖库 sudo yum install protobuf protobuf-c protobuf-c-devel protobuf-compiler protobuf-devel protobu ...
- js生成的cookie在yii2中获取不到的解决办法
在js中创建的cookie,默认用yii2中自带的方法Yii::$app->request->cookies->get('abc')获取不到,而用$_COOKIE['abc']又是能 ...
- iptables 认识 第二章
一.四表五链 netfilter 通过四表五链两个维度来定义数据包过滤规则. #上面图片中 raw 表不在postrouting 链中,请注意 上图中的五个位置也被称为五个钩子函数(hook func ...
- iptables 初见 第一章
官网:https://www.netfilter.org/ 简单来来说 ,netfilter 是一个工作在内核空间的数据包过滤系统,iptables 是一个工作在用户控件.调用netfilter 的规 ...
- 程序员的快速开发框架:Github上 10 大优秀的开源后台控制面板
程序员的快速开发框架:Github上 10 大优秀的开源后台控制面板 Web 开发中几乎的平台都需要一个后台管理,但是从零开发一套后台控制面板并不容易,幸运的是有很多开源免费的后台控制面板可以给开发者 ...
- Linux 修改SWAP分区后导致开机问题
Linux 系统出现提示原因 扩容后,修改了SWAP,或者安装了双 Linux 系统,在安装后一种 Linux 系统时把 SWAP分区 重新格式化,导致UUID 改变,所以启动时无法加载原来对应UUI ...