6 caisense

尚未进行身份认证

暂无相关描述

等级
TA的排名 1w+

JavaScript LocalStorage

https://www.cnblogs.com/xiaowei0705/archive/2011/04/19/2021372.html

2019-07-15 21:36:24

vue.js slot-scope 取值

错误:<templateslot-scope="scope"><!--取值必须用slot-scope--> <iclass="scope.row.isWork==='是'?'el-icon-circle-check':'el-icon-circle-close'"></i></template>正确:i...

2019-07-11 16:00:14

Vue 消除router-link 的下划线

https://www.cnblogs.com/wayneliu007/p/10357647.html

2019-07-11 11:18:14

JavaScript笔记

1.数组创建1.直接创建,缺点是不能批量创建(如长度100)a=[1,2,3]console.log(a) //[1,2,3]2.用new方法创建只用一个参数,则该参数表示数组长度,数组元素为nulla=newArray(1)console.log(a) //[<1emptyitem>]若要批量创建,用fil...

2019-07-05 15:39:14

move to gitbook

https://cai-sen-se.gitbook.io/leetcode/

2019-06-20 21:15:18

无法import fastText

https://github.com/facebookresearch/fastText/issues/474#issuecomment-445430211

2019-03-29 16:07:55

mac设置python版本切换,和设置python默认版本

Mac中python多版本切换$sudovi~/.bashrcshell中输入aliaspython2=’/Library/Frameworks/Python.framework/Versions/2.x/bin/python2.x’aliaspython3=’/Library/Frameworks/Python.framework/Versions/3.x/bin/...

2019-03-29 15:44:06

132. 分割回文串 II

https://leetcode-cn.com/problems/palindrome-partitioning-ii/comments/回溯(超时):classSolution:defminCut(self,s):""":types:str:rtype:int"""self.min...

2019-01-24 22:49:08

131. 分割回文串

https://leetcode-cn.com/problems/palindrome-partitioning/submissions/classSolution:defpartition(self,s):""":types:str:rtype:List[List[str]]"""s..

2019-01-23 12:27:19

130. 被围绕的区域

https://leetcode-cn.com/problems/surrounded-regions/comments/两次遍历。第一次先遍历边界,dfs将所有与边界O相连的O置为‘-’。之后再遍历所有,将所有O变为X,所有’-‘变为OclassSolution:defsolve(self,board):""":typeboard:Li...

2019-01-22 12:16:13

129. 求根到叶子节点数字之和

https://leetcode-cn.com/problems/sum-root-to-leaf-numbers/submissions/#Definitionforabinarytreenode.#classTreeNode:#def__init__(self,x):#self.val=x#self.left=...

2019-01-21 12:54:05

128. 最长连续序列

https://leetcode-cn.com/problems/longest-consecutive-sequence/用哈希表存储每个端点值对应连续区间的长度若数已在哈希表中:跳过不做处理若是新数加入:取出其左右相邻数已有的连续区间长度left和right计算当前数的区间长度为:cur_length=left+right+1根据cur_length更新最大长...

2019-01-20 13:52:14

433. 最小基因变化

https://leetcode-cn.com/problems/minimum-genetic-mutation/submissions/基本类似127题,bfsimportqueueclassSolution:defminMutation(self,start,end,bank):""":typestart:str...

2019-01-19 17:42:19

127. 单词接龙

https://leetcode-cn.com/problems/word-ladder/思路和126差不多,区别在于只用bfs,每次访问一层,用一个map来存储访问过的结点以及与起点的距离,避免重复访问。最后输出map中的终点项即可importqueueclassSolution:defladderLength(self,beginWord,endWord,wordL...

2019-01-18 16:37:24

126. 单词接龙 II

https://leetcode-cn.com/problems/word-ladder-ii/submissions/dfs+bfsimportqueueclassSolution:deffindLadders(self,beginWord,endWord,wordList):""":typebeginWord:str...

2019-01-17 18:39:12

125. 验证回文串

https://leetcode-cn.com/problems/valid-palindrome/comments/classSolution:defisPalindrome(self,s):""":types:str:rtype:bool"""#将s过滤,只保留数字和字母,再转为小...

2019-01-08 23:19:44

124. 二叉树中的最大路径和

https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/submissions/对于任意一个节点,如果最大和路径包含该节点,那么只可能是两种情况:1.其左右子树中所构成的和路径值较大的那个加上该节点的值后向父节点回溯构成最大路径2.左右子树都在最大路径中,加上该节点的值构成了最终的最大路径。#Definiti...

2019-01-08 22:44:27

123. 买卖股票的最佳时机 III

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/comments/dp1[i]=max(dp[i-1],prices[i]-minval)从前往后遍历,表示第1天到第i天之间的最大利润(通过是否在第i天卖出确认);dp2[i]=max(dp[i+1],maxval-prices[i]...

2019-01-06 16:17:14

122. 买卖股票的最佳时机 II

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/submissions/观察知,累加每两个相邻峰谷之间的差价即可classSolution(object):defmaxProfit(self,prices):""":typeprices:List[in...

2019-01-04 16:42:46

121. 买卖股票的最佳时机

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/solution/classSolution(object):defmaxProfit(self,prices):""":typeprices:List[int]:rtype:int...

2019-01-03 13:21:39

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!