久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

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

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

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

環(huán)境: idea2020.1

插件: LeetCode-editor 6.7

一、IDEA安裝LeetCode插件

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

安裝完成重啟idea

打開插件

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

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插件運行并調(diào)試本地樣例的方法詳解

代碼

package leetcode.editor.cn;import java.util.Arrays;//Java:兩數(shù)之和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'); } }}

總結(jié)

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

標簽: IDEA
相關文章:
主站蜘蛛池模板: 辽宁省| 夏邑县| 河东区| 名山县| 大港区| 且末县| 阿城市| 郴州市| 繁昌县| 鹤壁市| 辽宁省| 高要市| 牙克石市| 雅江县| 永春县| 西青区| 高青县| 永登县| 灵璧县| 宝兴县| 台北县| 昔阳县| 蓬莱市| 临沭县| 天柱县| 南投县| 凌源市| 缙云县| 广东省| 济南市| 鲁山县| 盘锦市| 呼玛县| 嘉义市| 于田县| 县级市| 会理县| 那坡县| 突泉县| 紫阳县| 密山市|