码迷,mamicode.com
首页 >  
搜索关键字:median of two sor    ( 12209个结果
python篇第3天【编码规范】
第二天加班去了! 语法约定: 多行语句 Python语句中一般以新行作为为语句的结束符。 但是我们可以使用斜杠( \)将一行的语句分为多行显示,如下所示: total = item_one + \ item_two + \ item_three 语句中包含[], {} 或 () 括号就不需要使用多行 ...
分类:编程语言   时间:2019-06-05 15:14:23    阅读次数:121
Leetcode 11 Container with most water【双指针】
总是莫名其妙被双指针的题卡到,其实双指针的题应该非常简单。 看到是array的题往two pointers上想就差不多了,然后它的核心不是说指针 i 和 j 指向的两个数构成最优解,而是说考虑 i 和 j 指向的其中一个数对答案的贡献,每次利用完throw away就行了。(同理two sum的双指 ...
分类:其他好文   时间:2019-06-05 09:49:40    阅读次数:64
LeetCode.893-特殊相等字符串组(Groups of Special-Equivalent Strings)
这是悦乐书的第 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
[Machine Learning for Trading] {ud501} Lesson 19: 02-09 The Fundamental Law of active portfolio management | Lesson 20: 02-10 Portfolio optimization and the efficient frontier
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
python复习——数据输入输出
标准输入: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
160. Intersection of Two Linked Lists
题目链接:https://leetcode.com/problems/intersection-of-two-linked-lists/ 解题思路: 两个链表的公共节点,首先让长的链表先走length1-length2步,然后一起走 ...
分类:其他好文   时间:2019-06-05 00:00:49    阅读次数:125
leetcode 1.Two sum
题目描述 "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
LeetCode 445. 两数相加 II(Add Two Numbers II)
445. 两数相加 II 445. Add Two Numbers II 题目描述 给定两个 非空链表 来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储单个数字。将这两数相加会返回一个新的链表。 你可以假设除了数字 0 之外,这两个数字都不会以零开头。 进阶: 如果输入链表不能修 ...
分类:其他好文   时间:2019-06-02 15:43:34    阅读次数:115
poj 2406
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
785. Is Graph Bipartite?( 判断是否为二分图)
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!