一、下载安装
点击File->Setting->Plugins,搜索leetcode再点击install进行下载。
下载完成后重启idea,右下角会有leetcode菜单。
二、配置
1.点击File->Settings->Tools->leetcode plugin,如图:
2.自定义模板配置
下面介绍我使用的配置模板为:
P$!{question.frontendQuestionId}_$!velocityTool.camelCaseName(${question.titleSlug})
package leetcode.editor.cn;
${question.content}
/**
* ${question.title}
*
* @author zhaohanqing
*/
public class P$!{question.frontendQuestionId}_$!velocityTool.camelCaseName(${question.titleSlug}){
public static void main(String[] args) {
Solution solution = new P$!{question.frontendQuestionId}_$!velocityTool.camelCaseName(${question.titleSlug})().new Solution();
}
${question.code}
}