
Python
文章平均质量分 62
weixin_42988124
这个作者很懒,什么都没留下…
展开
-
Python-list,set
list 定义 s = [] 用[]来保存数据,数据可以是不同的类型 添加或者删除数据 添加到尾部:s.append() 添加到中间:s.insert(1, ‘a’) 删除某个数据:s.pop(‘a’) 添加某个数组:s.append(s1)/s.extend(s1) set 1. s = set([‘A’, ‘B’, ‘C’]) 2. 用()来保存数据,数组内的数不...原创 2018-08-17 14:31:34 · 548 阅读 · 0 评论 -
Leetcode: Single Number — Python
Leetcode: Single Number — PythonQuestionAnswernote Question Given a non-empty array of integers, every element appears twice except for one. Find that single one. Answer class Solution(object): de...原创 2019-01-03 15:52:22 · 205 阅读 · 0 评论 -
Leetcode: Two Sum — python
leetcode questions — pythonQuestionAnswernotes Question Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would ...原创 2019-01-03 13:40:30 · 167 阅读 · 0 评论 -
Leetcode: Hamming Distance — Python
Leetcode: Hamming Distance — PythonQuestionAnswernotes Question The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x...原创 2019-01-03 14:56:45 · 252 阅读 · 0 评论 -
Leetcode: Drop Eggs — Python
Leetcode: Drop Eggs — PythonQuestionAnswernote Question You are given K eggs, and you have access to a building with N floors from 1 to N. Each egg is identical in function, and if an egg breaks, you ...原创 2019-01-08 22:04:44 · 351 阅读 · 0 评论