VSCode + GitHub 跟踪LeetCode刷题进度
动机
-
将刷题作为调整生活节奏的一种方式,活动脑筋
-
同步刷题记录到GitHub,让GitHub账号更活跃
-
锻炼基础的算法思维
方案
技术栈
VSCode; VSCode LeetCode Plugin; GitHub
流程
-
打开VSCode,下载LeetCode插件 VS Marketplace Link
-
配置LeetCode账号( 可以参考在vscode中配置LeetCode插件,从此愉快地刷题 - 掘金 )
-
如果要使用英文网站,目前(2022/01)需要使用cookie登陆;
-
cookie获取步骤: 浏览器登陆英文网站,右键“检查”,刷新,通过[Network] -> [XHR] -> [“all”] -> [Header] 复制完整cookie使用即可。
-
-
GitHub创建相应项目,并下载到本地 如 KenGeng/Ken-LeetCode-Solution: LeetCode Solution
-
将 LeetCode插件的默认目录设置为上述project的本地目录
-
修改vim .vscode/extensions/leetcode.vscode-leetcode-0.18.0/node_modules/vsc-leetcode-cli/templates/codeonly.tpl 文件:
${comment.start} ${comment.line} @lc app=${app} id=${fid} lang=${lang} ${comment.line} ${comment.line} [${fid}] ${name} ${comment.line} ${link} ${comment.line} ${comment.line} ${category} ${comment.line} ${level} (${percent}%) ${comment.line} Likes: ${likes} ${comment.line} Dislikes: ${dislikes} ${comment.line} Total Accepted: ${totalAC} ${comment.line} Total Submissions: ${totalSubmit} ${comment.line} Testcase Example: ${testcase} ${comment.end} ${comment.singleLine} @lc code=start ${code} ${comment.singleLine} @lc code=end

1369

被折叠的 条评论
为什么被折叠?



