第二天加班去了! 语法约定: 多行语句 Python语句中一般以新行作为为语句的结束符。 但是我们可以使用斜杠( \)将一行的语句分为多行显示,如下所示: total = item_one + \ item_two + \ item_three 语句中包含[], {} 或 () 括号就不需要使用多行 ...
分类:
编程语言 时间:
2019-06-05 15:14:23
阅读次数:
121
总是莫名其妙被双指针的题卡到,其实双指针的题应该非常简单。 看到是array的题往two pointers上想就差不多了,然后它的核心不是说指针 i 和 j 指向的两个数构成最优解,而是说考虑 i 和 j 指向的其中一个数对答案的贡献,每次利用完throw away就行了。(同理two sum的双指 ...
分类:
其他好文 时间:
2019-06-05 09:49:40
阅读次数:
64
这是悦乐书的第 344 次更新,第 368 篇原创 01 看题和准备 今天介绍的是 算法题中 级别的第 题(顺位题号是 )。 You are given an array A of strings. Two strings S and T are special equivalent if afte ...
分类:
其他好文 时间:
2019-06-05 09:40:37
阅读次数:
65
this lesson => Buffet said two things => (1) investor skill => (2) breadth / the number of investments Grinold's Fundamental Law breadth => more oppor ...
分类:
系统相关 时间:
2019-06-05 09:39:21
阅读次数:
148
标准输入:x=input()…… 标准输入:print()…… 格式化输出:1、字符串格式化运算符% 例:print('Values are %s,%s,%s.'%(1,2,['one','two'])) 输出:Values are 1,2,['one','two']. 说明:高亮的%用法相当于C语 ...
分类:
编程语言 时间:
2019-06-05 00:29:30
阅读次数:
102
题目链接:https://leetcode.com/problems/intersection-of-two-linked-lists/ 解题思路: 两个链表的公共节点,首先让长的链表先走length1-length2步,然后一起走 ...
分类:
其他好文 时间:
2019-06-05 00:00:49
阅读次数:
125
题目描述 "https://leetcode.com/problems/two sum/" 解决方法 一: 复制列表内容 L = [1,2,3] LL = L.copy() 或LL = L[:] 二: class Solution(object): def twoSum(self, nums, ta ...
分类:
其他好文 时间:
2019-06-04 22:28:25
阅读次数:
129
445. 两数相加 II 445. Add Two Numbers II 题目描述 给定两个 非空链表 来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储单个数字。将这两数相加会返回一个新的链表。 你可以假设除了数字 0 之外,这两个数字都不会以零开头。 进阶: 如果输入链表不能修 ...
分类:
其他好文 时间:
2019-06-02 15:43:34
阅读次数:
115
Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 64350 Accepted: 26531 Description Given two strings a and b we define a*b to ...
分类:
其他好文 时间:
2019-06-02 01:29:03
阅读次数:
125
Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two ind ...
分类:
其他好文 时间:
2019-06-02 01:19:49
阅读次数:
100