一、下載安裝
點擊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}
}