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 ...
随机推荐
- SqlServer父节点与子节点查询及递归
在最近老是用到这个SQL,所以记下来了: 1:创建表 CREATE TABLE [dbo].[BD_Booklet]( [ObjID] [int] IDENTITY(1,1) NOT NULL, [P ...
- 杨韬的Python/Jupyter学习笔记
Python语法学习 https://zhuanlan.zhihu.com/p/24162430 Python 安装库 安装Jupyter Notebook 先安装Python cmd 进入K:\Ju ...
- <转>jmeter(二十一)jmeter常用插件介绍
本博客转载自:http://www.cnblogs.com/imyalost/category/846346.html 个人感觉不错,对jmeter讲解非常详细,担心以后找不到了,所以转发出来,留着慢 ...
- 各种数据库连接字符串 -- c#
sqlite : connectionString="Data Source=|DataDirectory|\databasename.db;Pooling=true;FailIfMissi ...
- 生成id
package com.develop.web.util; import java.security.MessageDigest; import java.text.SimpleDateFormat; ...
- (转载)Unity学习笔记:关于Dropdown的学习
今天组长让我写一个界面,其中用到了下拉条,我的印象还停留在以前的NGUI有现成的组件,但是uGUI没有的那阶段,组长跟我说uGUI现在也有了,研究了一下,发现real方便哦,今天就来简单说一下用法吧. ...
- 【笔记】Cocos2dx学习笔记
自建场景类 自建场景类BaseScene继承与Scene类,在init函数中添加了默认的,键盘与鼠标事件的响应,添加了一个用于读取XML文件的字典,添加了一个结束场景的方法. 类的声明代码如下: #i ...
- Windows 启用/禁用内置管理员 Administrator
关于启用 Windows 系统内置的管理员 Administrator 的方法还是许多的,其中普遍的一种应该就是进入(我的电脑/计算机右键管理/Windows + R输入 compmgmt.msc)计 ...
- MVC强类型视图,详细信息展示【五】
一.在MVC三种讲到两种后端发送数据到前端的方法,今天讲的是第三种,发送过去的方法 [强类型视图]. 1. 强类型视图,就是指在传递的过程中只能传递一种类型的数据到该视图中,就比如默认的传递的数据类型 ...
- SpringBoot mybatis配置
首先pom.xml <!-- mybatis 配置 --> <dependency> <groupId>org.mybatis.spring.boot</gr ...