国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

IDEA2020.1使用LeetCode插件運行并調試本地樣例的方法詳解

瀏覽:54日期:2024-08-14 10:42:00

環境: idea2020.1

插件: LeetCode-editor 6.7

一、IDEA安裝LeetCode插件

IDEA2020.1使用LeetCode插件運行并調試本地樣例的方法詳解

安裝完成重啟idea

打開插件

IDEA2020.1使用LeetCode插件運行并調試本地樣例的方法詳解IDEA2020.1使用LeetCode插件運行并調試本地樣例的方法詳解

URL可以選擇國服和世界服。LoginName和Password填自己的用戶名和密碼即可。

需要配置的選項為:

TempFilePath: 自己保存代碼的包的位置

CodeFileName:

$!velocityTool.camelCaseName(${question.titleSlug})

CodeTemplate:

${question.content}package leetcode.editor.cn;//Java:${question.title}public class $!velocityTool.camelCaseName(${question.titleSlug}){ public static void main(String[] args) { Solution solution = new $!velocityTool.camelCaseName(${question.titleSlug})().new Solution(); // TO TEST } ${question.code}}

配置完成后 刷新即可

輸入代碼測試運行提交

IDEA2020.1使用LeetCode插件運行并調試本地樣例的方法詳解

代碼

package leetcode.editor.cn;import java.util.Arrays;//Java:兩數之和public class TwoSum { public static void main(String[] args) { Solution solution = new TwoSum().new Solution(); // TO TEST int[] a ={1, 2, 3, 4}; int[] ints = solution.twoSum(a, 3); System.out.println(Arrays.toString(ints)); } class Solution { public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if (nums[j] == target - nums[i]) { return new int[]{i, j}; } } } throw new IllegalArgumentException('No two sum solution'); } }}

總結

到此這篇關于IDEA2020.1使用LeetCode插件運行并調試本地樣例的方法詳解的文章就介紹到這了,更多相關IDEA LeetCode插件運行并調試本地樣例內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: IDEA
相關文章:
主站蜘蛛池模板: 武陟县| 柘荣县| 隆德县| 南漳县| 修文县| 沿河| 长汀县| 乌兰浩特市| 临城县| 册亨县| 孝昌县| 文化| 敦煌市| 河北区| 彩票| 称多县| 化州市| 曲麻莱县| 石狮市| 大化| 仁化县| 土默特右旗| 东至县| 新田县| 麻江县| 黄陵县| 敦煌市| 开江县| 瓦房店市| 寻乌县| 介休市| 南乐县| 隆安县| 霸州市| 武宣县| 民乐县| 云安县| 汶川县| 临潭县| 佛坪县| 页游|