commit 4e4b394aad4addb6312b567aa9a2c3c8a88f8289 Author: Kagura Date: Tue Mar 19 12:35:24 2024 +0800 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..1bec35e --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..df543e3 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..5cba058 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 0000000..b6883db --- /dev/null +++ b/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..cb3160a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..4f31eb0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/KtLeetcode.iml b/KtLeetcode.iml new file mode 100644 index 0000000..f889b2e --- /dev/null +++ b/KtLeetcode.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Main.kt b/src/Main.kt new file mode 100644 index 0000000..e62d862 --- /dev/null +++ b/src/Main.kt @@ -0,0 +1,7 @@ + + + +fun main() { + + +} \ No newline at end of file diff --git a/src/Test1.kt b/src/Test1.kt new file mode 100644 index 0000000..28d1511 --- /dev/null +++ b/src/Test1.kt @@ -0,0 +1,14 @@ +class Test1 { + fun twoSum(nums: IntArray, target: Int): IntArray { + val map = mutableMapOf(); + for (i in 0..nums.size){ + val find = target-nums[i]; + if (map.containsKey(find)){ + return intArrayOf(map[find]!!,i) + }else{ + map[nums[i]]=i + } + } + return intArrayOf(-1,-1) + } +} \ No newline at end of file diff --git a/src/Test2.kt b/src/Test2.kt new file mode 100644 index 0000000..9a13a3f --- /dev/null +++ b/src/Test2.kt @@ -0,0 +1,28 @@ +class Test2 { + + class ListNode(var `val`: Int) { + var next: ListNode? = null + } + + fun addTwoNumbers(l1: ListNode?, l2: ListNode?): ListNode? { + val cf = false + val result = ListNode(1) + if (l1 != null) { + if (l2!=null){ + + } + } + return null + } + + fun test(){ + val li1 = ListNode(2) + li1.next = ListNode(4) + li1.next!!.next = ListNode(3) + + val li2 = ListNode(5) + li2.next = ListNode(6) + li2.next!!.next = ListNode(4) + + } +} \ No newline at end of file