- 博客(16)
- 收藏
- 关注
原创 【Leetcode-算法-Python3】12. 整数转罗马数字/Integer to Roman
IDEAs- Find the biggest symbol and add the symbol(s) into the result (process 6 special instances).- Subtract the value of above symbol(s).- Stop until the difference equals 0. Submission De...
2019-02-16 14:44:26
140
原创 【Leetcode-算法-Python3】11. 盛最多水的容器/Container With Most Water
IDEAs- The biggest container of each line is composed with another line longer than itself.- Sort lengths.- For each line, find the farest one among lines longer than itself. Submission Det...
2019-02-14 17:37:09
130
转载 【linux小白学习之路】Linux系统中生成的txt文件转Windows中的txt文件
在Linux系统下, '\n'就是一个换行符,而在windows下,它是由回车换行组成。试了 unix2dos方法,不知道为什么安装不成功,还是nodepad++好用。参考这篇博https://www.crifan.com/files/doc/docbook/rec_soft_npp/release/htmls/npp_func_windows_unix_mac.html ...
2018-12-24 21:52:53
567
1
原创 【Leetcode-算法-Python3】9. 回文数
1.将整数转为字符串class Solution: def isPalindrome(self, x): """ :type x: int :rtype: bool """ re = False s = str(x) if s[0] == "-" or s[0] == "+":...
2018-06-23 17:10:42
332
原创 【Leetcode-算法-Python3】8.字符串转整数 (atoi)
为什么输入为" +0 123" 时,输出为0,而不是123???求解!1071 / 1079 个通过测试用例代码:class Solution: def myAtoi(self, str): """ :type str: str :rtype: int """ str = str.replace(" ", ""
2018-06-22 17:00:00
581
原创 【Leetcode-算法-Python3】7. 反转整数
思路:1.确定x位数2.取余3.累加4.溢出判断class Solution: def reverse(self, x): """ :type x: int :rtype: int """ flag = 0 if x < 0: flag = 1 x = abs(x) ...
2018-06-21 19:29:34
173
原创 【Leetcode-算法-Python3】6. Z字形变换
思路:- 第一行和最后一行的序号是等差数列;- 其余行序号是两个差值交替的序列。- 所有的差值均与行号有关。(Key)class Solution: def convert(self, s, numRows): """ :type s: str :type numRows: int :rtype: str """ ...
2018-06-19 19:26:07
279
原创 【Leetcode-算法-Python3】5. 最长回文子串
1. Brute methodclass Solution: def longestPalindrome(self, s): """ :type s: str :rtype: str """ if len(s) == 1: return s re = s[0] for i ...
2018-05-28 17:10:28
1066
原创 【Leetcode-算法-Python3】4. 两个排序数组的中位数
class Solution: def findMedianSortedArrays(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: float """ length = len(nums1)+len...
2018-05-28 17:06:27
866
原创 【Leetcode-算法-Python3】3. 无重复字符的最长子串
class Solution: def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ if len(s)==0: return 0 loc = {} re = 0 sta...
2018-05-28 17:05:17
635
原创 【Leetcode-算法-Python3】2. 两数相加
# Definition for singly-linked list.# class ListNode:# def __init__(self, x):# self.val = x# self.next = Noneclass Solution: def addTwoNumbers(self, l1, l2): """ :...
2018-05-28 17:03:47
1020
原创 【Leetcode-算法-Python3】1. 两数之和
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ for i,item in enumerate(nums): ...
2018-05-28 17:02:18
594
原创 【linux小白学习之路】ubuntu安装有道词典
今天开始装Opendaylight,想着先在虚拟机上装个有道词典,省的来回切换太麻烦。安装过程中各种依赖问题一一解决后,只有这个qml-module-qtquick-controls 安装不了,网上各种方法尝试亲测这个http://blog.csdn.net/brad1994/article/details/56484634有效,直接改controls文件。又学一招!
2017-11-08 22:16:17
287
原创 java.lang.NumberFormatException: For input string: ""
今天试着在eclipse里敲Algorithms, Part I,week1里的Union-Find的quick-find读入数对,用split(" ")分割后,String转int做参数,结果一直报错Exception in thread "main" java.lang.NumberFormatException: For input string: ""。没仔细读这个报错
2017-11-06 21:51:59
1587
原创 【linux小白学习之路】Ubuntu14.04安装某狗输入法
https://jingyan.baidu.com/article/ad310e80ae6d971849f49ed3.html亲测有效!
2017-10-26 16:15:09
238
原创 Kindle paperwhite 连不上wifi(校园网、360随身wifi)
在电脑上新建一个新文件,名为“WIFI_NO_NET_PROBE”,文件名没有引号,同时把后缀名删掉,让它变成一个无格式文件。kindle 连接电脑,把新建的文件放进kindke的根目录,断开kindle之后重启kindle。原贴:kindle吧 http://tieba.baidu.com/p/2322453080
2017-10-24 16:10:03
2137
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人