Skip to content

Commit cfcba03

Browse files
authored
Fixed lrln.
1 parent 2e4f7ed commit cfcba03

File tree

37 files changed

+741
-741
lines changed

37 files changed

+741
-741
lines changed

pom.xml

Lines changed: 153 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -1,153 +1,153 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.github.javadev</groupId>
5-
<artifactId>leetcode-in-kotlin</artifactId>
6-
<packaging>jar</packaging>
7-
<version>1.3-SNAPSHOT</version>
8-
<name>leetcode-in-kotlin</name>
9-
<description>Kotlin Solution for LeetCode algorithm problems, continually updating</description>
10-
<url>https://github.com/javadev/LeetCode-in-Kotlin</url>
11-
<developers>
12-
<developer>
13-
<name>Valentyn Kolesnikov</name>
14-
</developer>
15-
</developers>
16-
<licenses>
17-
<license>
18-
<name>The MIT License</name>
19-
<url>http://opensource.org/licenses/MIT</url>
20-
<distribution>repo</distribution>
21-
</license>
22-
</licenses>
23-
<scm>
24-
<connection>scm:git:git://github.com/javadev/LeetCode-in-Kotlin.git</connection>
25-
<developerConnection>scm:git:git://github.com/javadev/LeetCode-in-Kotlin.git</developerConnection>
26-
<url>https://github.com/javadev/LeetCode-in-Kotlin</url>
27-
</scm>
28-
<properties>
29-
<kotlin.version>1.7.10</kotlin.version>
30-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31-
</properties>
32-
<ciManagement>
33-
<system>GitHub Actions</system>
34-
<url>https://github.com/javadev/LeetCode-in-Kotlin/actions</url>
35-
</ciManagement>
36-
<issueManagement>
37-
<system>GitHub Issues</system>
38-
<url>https://github.com/javadev/LeetCode-in-Kotlin/issues</url>
39-
</issueManagement>
40-
<build>
41-
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
42-
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
43-
<plugins>
44-
<plugin>
45-
<groupId>org.jetbrains.kotlin</groupId>
46-
<artifactId>kotlin-maven-plugin</artifactId>
47-
<version>${kotlin.version}</version>
48-
<configuration>
49-
<jvmTarget>1.8</jvmTarget>
50-
</configuration>
51-
<executions>
52-
<execution>
53-
<id>compile</id>
54-
<phase>compile</phase>
55-
<goals>
56-
<goal>compile</goal>
57-
</goals>
58-
</execution>
59-
<execution>
60-
<id>test-compile</id>
61-
<phase>test-compile</phase>
62-
<goals>
63-
<goal>test-compile</goal>
64-
</goals>
65-
</execution>
66-
</executions>
67-
</plugin>
68-
<plugin>
69-
<groupId>org.apache.maven.plugins</groupId>
70-
<artifactId>maven-surefire-plugin</artifactId>
71-
<version>3.0.0-M5</version>
72-
<dependencies>
73-
<dependency>
74-
<groupId>org.junit.jupiter</groupId>
75-
<artifactId>junit-jupiter-engine</artifactId>
76-
<version>[5.9.0,)</version>
77-
</dependency>
78-
</dependencies>
79-
</plugin>
80-
</plugins>
81-
</build>
82-
<profiles>
83-
<profile>
84-
<id>release</id>
85-
<build>
86-
<plugins>
87-
<plugin>
88-
<groupId>org.apache.maven.plugins</groupId>
89-
<artifactId>maven-source-plugin</artifactId>
90-
<version>3.2.0</version>
91-
<executions>
92-
<execution>
93-
<id>attach-sources</id>
94-
<goals>
95-
<goal>jar</goal>
96-
<goal>test-jar</goal>
97-
</goals>
98-
</execution>
99-
</executions>
100-
</plugin>
101-
<plugin>
102-
<groupId>org.jetbrains.dokka</groupId>
103-
<artifactId>dokka-maven-plugin</artifactId>
104-
<version>1.6.0</version>
105-
<executions>
106-
<execution>
107-
<phase>prepare-package</phase>
108-
<goals>
109-
<goal>dokka</goal>
110-
<goal>javadoc</goal>
111-
<goal>javadocJar</goal>
112-
</goals>
113-
</execution>
114-
</executions>
115-
</plugin>
116-
<plugin>
117-
<groupId>org.apache.maven.plugins</groupId>
118-
<artifactId>maven-gpg-plugin</artifactId>
119-
<version>1.6</version>
120-
<executions>
121-
<execution>
122-
<id>sign-artifacts</id>
123-
<phase>verify</phase>
124-
<goals>
125-
<goal>sign</goal>
126-
</goals>
127-
</execution>
128-
</executions>
129-
</plugin>
130-
</plugins>
131-
</build>
132-
</profile>
133-
</profiles>
134-
<dependencies>
135-
<dependency>
136-
<groupId>org.jetbrains.kotlin</groupId>
137-
<artifactId>kotlin-stdlib-jdk8</artifactId>
138-
<version>${kotlin.version}</version>
139-
</dependency>
140-
<dependency>
141-
<groupId>org.junit.jupiter</groupId>
142-
<artifactId>junit-jupiter-api</artifactId>
143-
<version>[5.9.0,)</version>
144-
<scope>test</scope>
145-
</dependency>
146-
<dependency>
147-
<groupId>org.hamcrest</groupId>
148-
<artifactId>hamcrest-core</artifactId>
149-
<version>[2.2,)</version>
150-
<scope>test</scope>
151-
</dependency>
152-
</dependencies>
153-
</project>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.github.javadev</groupId>
5+
<artifactId>leetcode-in-kotlin</artifactId>
6+
<packaging>jar</packaging>
7+
<version>1.3-SNAPSHOT</version>
8+
<name>leetcode-in-kotlin</name>
9+
<description>Kotlin Solution for LeetCode algorithm problems, continually updating</description>
10+
<url>https://github.com/javadev/LeetCode-in-Kotlin</url>
11+
<developers>
12+
<developer>
13+
<name>Valentyn Kolesnikov</name>
14+
</developer>
15+
</developers>
16+
<licenses>
17+
<license>
18+
<name>The MIT License</name>
19+
<url>http://opensource.org/licenses/MIT</url>
20+
<distribution>repo</distribution>
21+
</license>
22+
</licenses>
23+
<scm>
24+
<connection>scm:git:git://github.com/javadev/LeetCode-in-Kotlin.git</connection>
25+
<developerConnection>scm:git:git://github.com/javadev/LeetCode-in-Kotlin.git</developerConnection>
26+
<url>https://github.com/javadev/LeetCode-in-Kotlin</url>
27+
</scm>
28+
<properties>
29+
<kotlin.version>1.7.10</kotlin.version>
30+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31+
</properties>
32+
<ciManagement>
33+
<system>GitHub Actions</system>
34+
<url>https://github.com/javadev/LeetCode-in-Kotlin/actions</url>
35+
</ciManagement>
36+
<issueManagement>
37+
<system>GitHub Issues</system>
38+
<url>https://github.com/javadev/LeetCode-in-Kotlin/issues</url>
39+
</issueManagement>
40+
<build>
41+
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
42+
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.jetbrains.kotlin</groupId>
46+
<artifactId>kotlin-maven-plugin</artifactId>
47+
<version>${kotlin.version}</version>
48+
<configuration>
49+
<jvmTarget>1.8</jvmTarget>
50+
</configuration>
51+
<executions>
52+
<execution>
53+
<id>compile</id>
54+
<phase>compile</phase>
55+
<goals>
56+
<goal>compile</goal>
57+
</goals>
58+
</execution>
59+
<execution>
60+
<id>test-compile</id>
61+
<phase>test-compile</phase>
62+
<goals>
63+
<goal>test-compile</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-surefire-plugin</artifactId>
71+
<version>3.0.0-M5</version>
72+
<dependencies>
73+
<dependency>
74+
<groupId>org.junit.jupiter</groupId>
75+
<artifactId>junit-jupiter-engine</artifactId>
76+
<version>[5.9.0,)</version>
77+
</dependency>
78+
</dependencies>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
<profiles>
83+
<profile>
84+
<id>release</id>
85+
<build>
86+
<plugins>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-source-plugin</artifactId>
90+
<version>3.2.0</version>
91+
<executions>
92+
<execution>
93+
<id>attach-sources</id>
94+
<goals>
95+
<goal>jar</goal>
96+
<goal>test-jar</goal>
97+
</goals>
98+
</execution>
99+
</executions>
100+
</plugin>
101+
<plugin>
102+
<groupId>org.jetbrains.dokka</groupId>
103+
<artifactId>dokka-maven-plugin</artifactId>
104+
<version>1.6.0</version>
105+
<executions>
106+
<execution>
107+
<phase>prepare-package</phase>
108+
<goals>
109+
<goal>dokka</goal>
110+
<goal>javadoc</goal>
111+
<goal>javadocJar</goal>
112+
</goals>
113+
</execution>
114+
</executions>
115+
</plugin>
116+
<plugin>
117+
<groupId>org.apache.maven.plugins</groupId>
118+
<artifactId>maven-gpg-plugin</artifactId>
119+
<version>1.6</version>
120+
<executions>
121+
<execution>
122+
<id>sign-artifacts</id>
123+
<phase>verify</phase>
124+
<goals>
125+
<goal>sign</goal>
126+
</goals>
127+
</execution>
128+
</executions>
129+
</plugin>
130+
</plugins>
131+
</build>
132+
</profile>
133+
</profiles>
134+
<dependencies>
135+
<dependency>
136+
<groupId>org.jetbrains.kotlin</groupId>
137+
<artifactId>kotlin-stdlib-jdk8</artifactId>
138+
<version>${kotlin.version}</version>
139+
</dependency>
140+
<dependency>
141+
<groupId>org.junit.jupiter</groupId>
142+
<artifactId>junit-jupiter-api</artifactId>
143+
<version>[5.9.0,)</version>
144+
<scope>test</scope>
145+
</dependency>
146+
<dependency>
147+
<groupId>org.hamcrest</groupId>
148+
<artifactId>hamcrest-core</artifactId>
149+
<version>[2.2,)</version>
150+
<scope>test</scope>
151+
</dependency>
152+
</dependencies>
153+
</project>
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
package g0001_0100.s0001_two_sum
2-
3-
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table
4-
// #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays
5-
// #2022_07_14_Time_234_ms_(92.75%)_Space_37.5_MB_(93.77%)
6-
7-
class Solution {
8-
fun twoSum(numbers: IntArray, target: Int): IntArray {
9-
val indexMap: MutableMap<Int, Int> = HashMap()
10-
for (i in numbers.indices) {
11-
val requiredNum = target - numbers[i]
12-
if (indexMap.containsKey(requiredNum)) {
13-
return intArrayOf(indexMap[requiredNum]!!, i)
14-
}
15-
indexMap[numbers[i]] = i
16-
}
17-
return intArrayOf(-1, -1)
18-
}
19-
}
1+
package g0001_0100.s0001_two_sum
2+
3+
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table
4+
// #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays
5+
// #2022_07_14_Time_234_ms_(92.75%)_Space_37.5_MB_(93.77%)
6+
7+
class Solution {
8+
fun twoSum(numbers: IntArray, target: Int): IntArray {
9+
val indexMap: MutableMap<Int, Int> = HashMap()
10+
for (i in numbers.indices) {
11+
val requiredNum = target - numbers[i]
12+
if (indexMap.containsKey(requiredNum)) {
13+
return intArrayOf(indexMap[requiredNum]!!, i)
14+
}
15+
indexMap[numbers[i]] = i
16+
}
17+
return intArrayOf(-1, -1)
18+
}
19+
}

src/main/kotlin/g0001_0100/s0001_two_sum/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1\. Two Sum
1+
1\. Two Sum
22

33
Easy
44

0 commit comments

Comments
 (0)