- 博客(12)
- 收藏
- 关注
原创 python 处理 csv file 变色
读csv文件,把符合条件的行/列变色:例如:如果mylist里的item在第一列中,把那一行highlightimport csv# 读取csv至字典csvFile = open("instance.csv", "r")reader = csv.reader(csvFile)# 建立空字典result = {}for item in reader: result[item[0]] = itemcsvFile.close()print(result)mylist =
2020-06-07 07:25:49 3243
原创 leetcode-268
Missing Number题目Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Yo
2017-07-17 15:50:37 242
原创 leetcode-283
Move Zeroes 题目Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], a
2017-07-17 14:10:24 762
原创 leetcode-1
Two Sum 题目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 have exactly one solution, and you may n
2017-07-17 13:28:37 255
原创 leetcode-122
Best Time to Buy and Sell Stock II 题目Say you have an array for which the ith element is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as
2017-07-17 10:08:08 416
原创 leetcode-121
Best Time to Buy and Sell Stock题目Say you have an array for which the ith element is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie, buy
2017-07-14 17:18:29 216
原创 leetcode-88
Merge Sorted Array 题目Given two sorted integer arrays nums1 and nums2, merge nums2 intonums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equ
2017-07-14 10:10:54 374
原创 leetcode-53
Maximum Subarray题目Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguou
2017-07-13 13:39:45 203
原创 leetcode-35
Search Insert Position 题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assum
2017-07-13 11:02:51 181
原创 leetcode-27
Remove Element 题目Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place wi
2017-07-13 10:32:31 137
原创 leetcode-26
题目Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for another array, you must do this in place
2017-07-13 10:03:57 193
转载 Mac操作系统下MySQL密码忘记后重置密码的方法
安装好MySQL以后,系统给了个默认的的密码,然后说如果忘记了默认的密码。。。。。。我复制了默认密码就走过了只一步,这一步就是我漫长旅程的开始。他给的密码太复杂了,当然我得换一个,而且我还要假装我不记得密码了,就这样我走上了不归路。。。。。。这个过程是心酸的,网上的资料多如狗,关键是各有各的错法,尝试了半天没一个对的,在即将打破心理防线,要去翻MySQL文档的时候,我改成功了。没有一个文章告诉
2017-07-07 16:04:22 370
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人