#lint

剑指offer 最小的k个数 、 leetcode 215. Kth Largest Element in an Array 、lintcode 80. Median、295. Find Median from Data Stream(剑指 数据流中位数) topK

  注意multiset的一个bug:multiset带一个参数的erase函数原型有两种。一是传递一个元素值,如上面例子代码中,这时候删除的是集合中所有值等于输入值的元素,并且返回删除的元素个数;另外一种是传递一个指向某个元素的iterator,这时候删除的就是这个对应的元素,无返回值。https...

lintcode 77.Longest Common Subsequence(最长公共子序列)、79. Longest Common Substring(最长公共子串)

LongestCommonSubsequence最长公共子序列:每个dp位置表示的是第i、j个字母的最长公共子序列classSolution{public:intfindLength(vector<int>&A,vector<int>&B){intlen1=A.size();in...

k sum(lintcode)

没通过的代码:classSolution{public:/**@paramA:Anintegerarray*@paramk:Apositiveinteger(k<=length(A))*@paramtarget:Aninteger*@return:Aninteger*/intkSum(vector<int&...
代码星球 代码星球·2020-10-13

背包问题2 (lintcode)

这里:for(intj=1;j<=m;j++)result[0][j]=0x80000000;不能从0开始,result[0][0]是可以取到的,是0。其他情况取不到才用最小表示。classSolution{public:/**@paramm:Anintegermdenotesthesizeofabackpack...
代码星球 代码星球·2020-10-13

92.背包问题(lintcode)

注意j-A[i-1]必须大于等于0,只大于0会报错classSolution{public:/***@paramm:Anintegermdenotesthesizeofabackpack*@paramA:GivennitemswithsizeA[i]*@return:Themaximumsize*/intbackPac...
代码星球 代码星球·2020-10-13

79 最长公共子串 (lintcode)

 f[i][j]表示的是以第i个结尾和第j个结尾classSolution{public:/**@paramA:Astring*@paramB:Astring*@return:thelengthofthelongestcommonsubstring.*/intlongestCommonSubstring(st...

77 最长公共子序列 (lintcode)

注意:因为开的空间是length+1的,对于字符串的下标计算要-1classSolution{public:/**@paramA:Astring*@paramB:Astring*@return:ThelengthoflongestcommonsubsequenceofAandB*/intlongestCommonSub...

代码校验工具 SublimeLinter 的安装与使用

来源于:https://gaohaoyang.github.io/2015/03/26/sublimeLinter/ 本文我将讲述一下SublimeLinter的安装过程。其组件jshint的安装与使用。其组件csslint的安装与使用。我将基于 SublimeText3 来安装。使用Su...

ubuntu18.04使用vscode报pylint is not install错误

1、安装pip:sudoapt-getinstallpip,如果使用python3则需要安装pip3:sudoapt-getinstallpython3-pip2、使用pip安装pylint:pipinstallpylint或者pip3installpylint3、在vscode中选择python2或者python3作...

取代eslint.autofix

参考资料:https://zhuanlan.zhihu.com/p/103492877在首选项,settiings.json加上"editor.codeActionsOnSave":{"source.fixAll.eslint":true} ...
代码星球 代码星球·2020-08-29

vscode下eslint代码规范

直接上规范吧://将设置放入此文件中以覆盖默认设置{"editor.fontSize":17,"editor.tabSize":2,"editor.formatOnSave":false,"files.associations":{"*.vue":"vue"},"eslint.validate":["javascrip...
代码星球 代码星球·2020-08-08

eslint校验——开启服务后自动校验

"[javascriptreact]":{"editor.defaultFormatter":"esbenp.prettier-vscode"},"[javascript]":{"editor.defaultFormatter":"vscode.typescript-language-features"},"vetur...

ESLint——从零学起

介绍ESLint最初是由NicholasC.Zakas于2013年6月创建的开源项目。它的目标是提供一个插件化的javascript代码检测工具。因此,ESLint就是一个语法规则和代码风格的检查工具,可以用来保证写出语法正确、风格统一的代码。安装和使用先决条件:Node.js(>=4.x),npm版本2+。有两...
代码星球 代码星球·2020-08-08

webstorm启动vue,出现Errors: 8 http://eslint.org/docs/rules/indent等错误解决方法

 用webstorm创建工程的时候,提示提示是否启用eslint检测的。 UseESLinttolintyourcode?这里有两种处理方式:1、直接选择no,后面的工程代码不受eslint限制2、如果没有留意选择yes,可进行以下方式处理:   在build/webp...

AS之Lint 工具

AndroidStudio内置的Lint工具,对app中的代码规范带来了极大的方便。对内存泄漏、代码冗余、代码安全、国际化、代码规范等很多方面都能检测,是一款非常强大的工具!使用:在AS-->Analyze-->InspectCode下 InspectCode配置(可以单独选择Module'app...
代码星球 代码星球·2020-08-06
首页上一页12345...下一页尾页